3.4.0-beta3
[phpmyadmin/sankalp_k.git] / scripts / mergepo.py
blobb816c7aab4e3d649c753a4c91e21ab29c0942d48
1 #!/usr/bin/python
3 import polib
4 import sys
6 po = polib.pofile(sys.argv[1])
7 poupdate = polib.pofile(sys.argv[2])
9 for origentry in po.fuzzy_entries():
10 for updateentry in poupdate.translated_entries():
11 if origentry.msgctxt is None and origentry.msgid == updateentry.msgid:
12 origentry.msgstr = updateentry.msgstr
13 origentry.flags.remove('fuzzy')
14 break
15 for origentry in po.untranslated_entries():
16 for updateentry in poupdate.translated_entries():
17 if origentry.msgctxt is None and origentry.msgid == updateentry.msgid:
18 origentry.msgstr = updateentry.msgstr
19 break
21 po.save()