[Po4a-devel] Unfuzzying and docs corrections.

Denis Barbier bouzim at gmail.com
Mon Jul 26 08:27:03 UTC 2010


On 2010/7/26 David Prévot wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> Le 25/07/2010 18:41, Omar Campagne a écrit :
>> David, just shout if you want/need a hand with the unfuzzying of
>> the translated files (or sthg you can think of).
>
> Thanks a lot for the offer: I've quite finish to modify every style
> stuff the way I presented them earlier on this thread, and it appears to
> be a huge patch (~90KB already, at least the documentation is not yet
> translated in as much languages than the runtime strings)...
>
> I'm not quite sure of what will be the best way to proceed (in fact
> there is now way it could automatically be unfuzzied, except maybe for a
> tiny part of the strings, but it won't worth to separate them).
>
> I can think of two approach:
>        - proceed one master file at a time: updating one of the master
>          document, and unfuzzy the corresponding PO files;
>        - apply the whole patch, and proceed one PO file at a time.

Please have a look at  msguntypot, this may help a lot.
When English documentation is reviewed, it would be great to split
changes into two patchsets, the first one containing English fixes
with no semantic changes (for which no translation changes are
needed), and the second one containing semantic changes.  You can then
proceed like this:
  $ # Backup original files
  $ cd po/pod
  $ mkdir orig
  $ cp *.pot orig
  $ cd -
  $ # Apply first patchset
  $ patch -p0 < no-semantic-changes.diff
  patching file doc/po4a-build.conf.5.pod
  patching file...
  $ # Rebuild PO and POT files
  $ make
  $ cd po/pod
  $ # Restore PO files
  $ cp orig/*.po .
  $ # Run msguntypot to update PO files with new msgids
  $ msguntypot -o orig/po4a-pod.pot -n po4a-pod.pot *.po
  $ cd -
  $ # Check that only msgids are modified
  $ make stats
  [files in po/pod and po/pod/orig must have the same number of
translated/fuzzy/untranslated strings]
  $ # Really check that only msgids are modified
  $ cd po/pod
  $ for f in *.po; do \
     msgcat -w 0 $f > $f.new;
     msgcat -w 0 orig/$f > $f.old;
     diff -u -I '^msgid "' $f.old $f.new
    done
   [only file headers printed, no changes]
   $ # Apply second patchset
   $ patch -p0 < semantic-changes.diff
   $ # Rebuild PO and POT files
   $ make

Unfortunately you will discover (like me ;)) that
lib/Locale/Po4a/Po.pm does not handle previous translations (flagged
with '#|'), they are removed in new files.  I will try to fix that
tonight so that msguntypot from po4a 0.40 works as described above.

Denis



More information about the Po4a-devel mailing list