Add script for unfuzzying translations with removed context.
This commit is contained in:
16
scripts/mergepo.py
Executable file
16
scripts/mergepo.py
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import polib
|
||||||
|
import sys
|
||||||
|
|
||||||
|
po = polib.pofile(sys.argv[1])
|
||||||
|
poupdate = polib.pofile(sys.argv[2])
|
||||||
|
|
||||||
|
for origentry in po.fuzzy_entries():
|
||||||
|
for updateentry in poupdate.translated_entries():
|
||||||
|
if origentry.msgctxt is None and origentry.msgid == updateentry.msgid:
|
||||||
|
origentry.msgstr = updateentry.msgstr
|
||||||
|
origentry.flags.remove('fuzzy')
|
||||||
|
|
||||||
|
po.save()
|
||||||
|
|
@@ -106,6 +106,8 @@ for lang in lang/*.inc.php ; do
|
|||||||
s/FULL NAME <EMAIL@ADDRESS>/Automatically generated/;
|
s/FULL NAME <EMAIL@ADDRESS>/Automatically generated/;
|
||||||
s/Report-Msgid-Bugs-To: .*\\\\n/Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\\\\n/;
|
s/Report-Msgid-Bugs-To: .*\\\\n/Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\\\\n/;
|
||||||
" po/$langcode-update.po
|
" po/$langcode-update.po
|
||||||
|
./scripts/mergepo.py po/$langcode.po po/$langcode-update.po
|
||||||
msgmerge -U -C po/$langcode-update.po po/$langcode.po po/phpmyadmin.pot
|
msgmerge -U -C po/$langcode-update.po po/$langcode.po po/phpmyadmin.pot
|
||||||
|
rm po/$langcode-update.po po/$loc.php
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Reference in New Issue
Block a user