From 44eb45b95a52172ea6f9a25ae62e9793daa42eb4 Mon Sep 17 00:00:00 2001 From: hertzog Date: Tue, 10 Jan 2012 07:33:56 +0000 Subject: [PATCH 1/1] Update best practice about unfuzzying PO file translations to recommend msguntypot. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Thanks to David Prévot for the patch. Acked-by: Christian Perrier Closes: #655153 git-svn-id: svn://anonscm.debian.org/ddp/manuals/trunk/developers-reference@9030 313b444b-1b9f-4f58-a734-7bb04f332e8d --- best-pkging-practices.dbk | 108 ++++++++------------------------------ debian/changelog | 3 ++ 2 files changed, 24 insertions(+), 87 deletions(-) diff --git a/best-pkging-practices.dbk b/best-pkging-practices.dbk index bbcf706..575a80f 100644 --- a/best-pkging-practices.dbk +++ b/best-pkging-practices.dbk @@ -830,128 +830,62 @@ If you don't do so, the whole template will not be translated as long as a translator will send you an update. -To unfuzzy translations, you can use two methods. The first -method does preventive search and replace actions in the -PO files. The latter uses gettext utilities to unfuzzy -strings. - - -Preventive unfuzzy method: +To unfuzzy translations, you can use +msguntypot (part of the po4a package). -Try finding a complete translation file before -the change: - -for i in debian/po/*po; do echo -n $i: ; msgfmt -o /dev/null --statistics $i; done - -The file only showing translated items will be used -as the reference file. If there is none (which should not happen if you take -care to properly interact with translators), you should use the file -with the most translated strings. - - - - -Identify the needed change. In this example, let's assume the change is about -fixing a typo in the word typo which was inadvertently -written as tpyo. Therefore, the change is -s/tpyo/typo. - - - - -Check that this change is only applied to the place where you really intend -to make it and not in any other place -where the original string is appropriate. This specifically applies to -change in punctuation, for instance. - - - - -Modify all PO files by using sed. The use of that command -is recommended over any text editor to guarantee that the files encoding will -not be broken by the edit action: - - -cd debian/po -for i in *.po; do sed -i 's/tpyo/typo/g' $i; done - - - - -Change the debconf template file to fix the typo. +Regenerate the POT and PO files. +debconf-updatepo -Run debconf-updatepo. +Make a copy of the POT file. +cp templates.pot templates.pot.orig -Check the foo.po reference file. Its statistics should -not be changed: +Make a copy of all the PO files. - -msgfmt -o /dev/null --statistics debian/po/foo.po - +mkdir po_fridge; cp *.po po_fridge -If the file's statistics changed, you did something wrong. Try again -or ask for help on the &email-debian-i18n; mailing list. +Change the debconf template files to fix the typos. - - -Gettext utilities method: - - -Put all incomplete PO files out of the way. You can check the completeness by -using (needs the gettext package -installed): +Regenerate the POT and PO files (again). -for i in debian/po/*po; do echo -n $i: ; msgfmt -o /dev/null --statistics $i; done - - - -Move all files which report either fuzzy strings to a temporary place. Files -which report no fuzzy strings (only translated and untranslated) will be kept -in place. - - - - -Now and now only, modify the template for -the typos and check again that translation are not impacted (typos, spelling -errors, sometimes typographical corrections are usually OK). - - - +debconf-updatepo -Run debconf-updatepo. This will fuzzy all strings you -modified in translations. You can see this by running the above again. +At this point, the typo fix fuzzied all the translations, and this +unfortunate change is the only one between the PO files of your main +directory and the one from the fridge. Here is how to solve this. -Use the following command: +Discard fuzzy translation, restore the ones from the fridge. -for i in debian/po/*po; do msgattrib --output-file=$i --clear-fuzzy $i; done +cp po_fridge/*.po . -Move back to debian/po the files which showed fuzzy strings in the first step. +Manually merge the PO files with the new POT file, but taking the useless fuzzy into account. +msguntypot -o templates.pot.orig -n templates.pot *.po -Run debconf-updatepo again. +Clean up. +rm -rf templates.pot.orig po_fridge diff --git a/debian/changelog b/debian/changelog index af30dec..fd918ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,9 @@ developers-reference (3.4.7) UNRELEASED; urgency=low Thanks to Luca Falavigna for the patch. * Drop section about yada. Its usage is highly discouraged. Closes: #643935 Thanks to Luca Falavigna for the patch. + * Update best practice about unfuzzying PO file translations to recommend + msguntypot. Thanks to David Prévot for the patch. + Acked-by Christian Perrier. Closes: #655153 [ David Prévot ] * Add doc-base file for the German translation. -- 2.30.2