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')
15 if origentry
.msgctxt
== updateentry
.msgctxt
and origentry
.msgid
== updateentry
.msgid
:
16 origentry
.msgstr
= updateentry
.msgstr
17 origentry
.flags
.remove('fuzzy')
19 for origentry
in po
.untranslated_entries():
20 for updateentry
in poupdate
.translated_entries():
21 if origentry
.msgctxt
is None and origentry
.msgid
== updateentry
.msgid
:
22 origentry
.msgstr
= updateentry
.msgstr
24 if origentry
.msgctxt
== updateentry
.msgctxt
and origentry
.msgid
== updateentry
.msgid
:
25 origentry
.msgstr
= updateentry
.msgstr