From 447da3026c63e3e64000a8654bd1bcc19833fe45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 15 Mar 2010 12:05:23 +0100 Subject: [PATCH] Add script for unfuzzying translations with removed context. --- scripts/mergepo.py | 16 ++++++++++++++++ scripts/php2gettext.sh | 2 ++ 2 files changed, 18 insertions(+) create mode 100755 scripts/mergepo.py diff --git a/scripts/mergepo.py b/scripts/mergepo.py new file mode 100755 index 000000000..21d6cce9c --- /dev/null +++ b/scripts/mergepo.py @@ -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() + diff --git a/scripts/php2gettext.sh b/scripts/php2gettext.sh index 675032345..0b33ce311 100755 --- a/scripts/php2gettext.sh +++ b/scripts/php2gettext.sh @@ -106,6 +106,8 @@ for lang in lang/*.inc.php ; do s/FULL NAME /Automatically generated/; s/Report-Msgid-Bugs-To: .*\\\\n/Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\\\\n/; " 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 + rm po/$langcode-update.po po/$loc.php fi done