chiark / gitweb /
Update best practice about unfuzzying PO file translations to recommend msguntypot.
authorhertzog <hertzog@313b444b-1b9f-4f58-a734-7bb04f332e8d>
Tue, 10 Jan 2012 07:33:56 +0000 (07:33 +0000)
committerhertzog <hertzog@313b444b-1b9f-4f58-a734-7bb04f332e8d>
Tue, 10 Jan 2012 07:33:56 +0000 (07:33 +0000)
Thanks to David Prévot for the patch.

Acked-by: Christian Perrier <bubulle@debian.org>
Closes: #655153
git-svn-id: svn://anonscm.debian.org/ddp/manuals/trunk/developers-reference@9030 313b444b-1b9f-4f58-a734-7bb04f332e8d

best-pkging-practices.dbk
debian/changelog

index bbcf706eb2321812c0540149b18e46be63a96b15..575a80fc3f9e7d66a799e7d210a53de0b6985671 100644 (file)
@@ -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.
 </para>
 <para>
-To <emphasis>unfuzzy</emphasis> translations, you can use two methods. The first
-method does <emphasis>preventive</emphasis> search and replace actions in the
-PO files. The latter uses <command>gettext</command> utilities to <emphasis>unfuzzy</emphasis>
-strings.
-</para>
-<para>
-<emphasis>Preventive unfuzzy</emphasis> method:
+To <emphasis>unfuzzy</emphasis> translations, you can use
+<command>msguntypot</command> (part of the <systemitem
+role="package">po4a</systemitem> package).
 </para>
 <orderedlist numeration="arabic">
 <listitem>
 <para>
-Try finding a complete translation file <emphasis role="strong">before</emphasis>
-the change:
-</para>
-<programlisting>for i in debian/po/*po; do echo -n $i: ; msgfmt -o /dev/null --statistics $i; done</programlisting>
-<para>
-The file only showing <emphasis>translated</emphasis> 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.
-</para>
-</listitem>
-<listitem>
-<para>
-Identify the needed change. In this example, let's assume the change is about
-fixing a typo in the word <literal>typo</literal> which was inadvertently
-written as <literal>tpyo</literal>. Therefore, the change is
-<command>s/tpyo/typo</command>.
-</para>
-</listitem>
-<listitem>
-<para>
-Check that this change is only applied to the place where you really intend
-to make it and <emphasis role="strong">not</emphasis> in any other place
-where the original string is appropriate. This specifically applies to
-change in punctuation, for instance.
-</para>
-</listitem>
-<listitem>
-<para>
-Modify all PO files by using <command>sed</command>. 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:
-</para>
-<programlisting>
-cd debian/po
-for i in *.po; do sed -i 's/tpyo/typo/g' $i; done
-</programlisting>
-</listitem>
-<listitem>
-<para>
-Change the debconf template file to fix the typo.
+Regenerate the POT and PO files.
 </para>
+<programlisting>debconf-updatepo</programlisting>
 </listitem>
 <listitem>
 <para>
-Run <command>debconf-updatepo</command>.
+Make a copy of the POT file.
 </para>
+<programlisting>cp templates.pot templates.pot.orig</programlisting>
 </listitem>
 <listitem>
 <para>
-Check the <filename>foo.po</filename> reference file. Its statistics should
-not be changed:
+Make a copy of all the PO files.
 </para>
-<programlisting>
-msgfmt -o /dev/null --statistics debian/po/foo.po
-</programlisting>
+<programlisting>mkdir po_fridge; cp *.po po_fridge</programlisting>
 </listitem>
 <listitem>
 <para>
-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.
 </para>
 </listitem>
-</orderedlist>
-<para>
-Gettext utilities method:
-</para>
-<orderedlist numeration="arabic">
 <listitem>
 <para>
-Put all incomplete PO files out of the way.  You can check the completeness by
-using (needs the <systemitem role="package">gettext</systemitem> package
-installed):
+Regenerate the POT and PO files (again).
 </para>
-<programlisting>for i in debian/po/*po; do echo -n $i: ; msgfmt -o /dev/null --statistics $i; done</programlisting>
-</listitem>
-<listitem>
-<para>
-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.
-</para>
-</listitem>
-<listitem>
-<para>
-Now <emphasis role="strong">and now only</emphasis>, modify the template for
-the typos and check again that translation are not impacted (typos, spelling
-errors, sometimes typographical corrections are usually OK).
-</para>
-</listitem>
-<listitem>
+<programlisting>debconf-updatepo</programlisting>
 <para>
-Run <command>debconf-updatepo</command>.  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.
 </para>
 </listitem>
 <listitem>
 <para>
-Use the following command:
+Discard fuzzy translation, restore the ones from the fridge.
 </para>
-<programlisting>for i in debian/po/*po; do msgattrib --output-file=$i --clear-fuzzy $i; done</programlisting>
+<programlisting>cp po_fridge/*.po .</programlisting>
 </listitem>
 <listitem>
 <para>
-Move back to <filename>debian/po</filename> 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.
 </para>
+<programlisting>msguntypot -o templates.pot.orig -n templates.pot *.po</programlisting>
 </listitem>
 <listitem>
 <para>
-Run <command>debconf-updatepo</command> again.
+Clean up.
 </para>
+<programlisting>rm -rf templates.pot.orig po_fridge</programlisting>
 </listitem>
 </orderedlist>
 </section>
index af30decddc8c62b577f4a3438b0d898701c5d541..fd918ae8e5816503488fa856a6e03ee5d25930c3 100644 (file)
@@ -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.