[WINEDOCS] Add French translation for Wine's FAQ

Francois Gouget fgouget at codeweavers.com
Thu May 12 09:49:47 CDT 2005


This patch adds the framework for translating Wine's documentation and 
adds a translation of the FAQ to French as a demonstration.

The credits for the translation go to Romuald VIEUX and to Yvon BENOIST 
for the proof-reading. Other students from the same school (INSA de 
Rouen) also translated the Wine User Guide and the Winelib User Guide 
but I thought I'd just submit the smallest one for now to keep the size 
of the patch down (with all three translations it's 950KB+ uncompressed).

Here is what the framework does:

  * first it moves most of en/Makefile.in to Make.rules.in so that this 
code can be shared across the various translations.

  * it adds one subdirectory for each language. Currently there's only 
one extra subdirectory: 'fr'.

  * the actual translation is stored in a po file, one per documentation 
document. So for French we currently have fr/wine-faq.po and later we 
will also have wineusr-guide.po and winelib-guide.po.

  * Using po files lets us track exactly which translation paragraphs 
are up to date and which are not. It also lets us leverage the tools 
that have been developed around that format such as KBabel and maybe 
even make it possible for contributors to translate the documentation 
online using tools like Pootle (http://pootle.wordforge.org/), Kartouche 
(http://i18n.kde.org/tools/kartouche/) or Rosetta 
(https://launchpad.ubuntu.com/rosetta).

  * The link between the SGML files and the PO files and back is handled 
by PO4A (http://po4a.alioth.debian.org/).

  * So configure.ac checks for the po4a tools. If they are missing then 
the translated documentation cannot be built. I also added a 
Makepo.rules.in that should be used by Makefiles building translated 
documentation. What it does is just include the main Make.rules.in file 
and add a couple of rules for generating SGML using PO files, and 
extending the 'clean' target. This last bit cannot be put in the 
top-level Make.rules.in because it does '$(RM) $(ALLBOOKS:%=%.sgml)' 
which would be unfortunate in the en directory.

  * Here is what you see when you compile the French translation:

     cd ../en && po4a-translate -v -f sgml -m wine-faq.sgml -p
      ../fr/wine-faq.po -l ../fr/wine-faq.posgml -k 1
     wine-faq.sgml is 97.4% translated (263 of 270 strings).

This generates a French SGML file from the current English SGML sources 
in ../en and the translation information contained in fr/wine-faq.po. 
Any paragraph for which there is no up-to-date translation will be 
passed as is, i.e. in English. The stats indicate that currently 97.4% 
of the paragraphs have an up-to-date translation (i.e. we are only 
missing translations for 7 paragraphs). Next comes:

     sed -e 's/^<\(article .*\) lang="en">$/<\1 lang="fr">/'  -e
      's/^<\(book .*\) lang="en">$/<\1 lang="fr">/' wine-faq.posgml
      >wine-faq.sgml || (rm -f wine-faq.sgml && false)

I admit this is sort of a hack. DocBook itself generates some text such 
as 'Table of Contents'. In the French documentation this text should be 
in French which can be achieved by setting the lang field to 'fr' on the 
<book> and <article> tags. This is what this little bit of sed does.

     docbook2html -u wine-faq.sgml
     Using catalogs: /etc/sgml/catalog
     Using stylesheet: /usr/share/docbook-utils/docbook-utils.dsl#html
     Working on: /home/fgouget/wine/winedocs/fr/wine-faq.sgml
     Done.

This is the regular DocBook call generating an HTML file from the SGML 
source, here the fr/wine-faq.sgml file that was just generated.

     rm wine-faq.sgml

This is make removing temporary files.

  * To update the translation do 'cd fr; make updatepo', edit 
'wine-faq.po' and look for the 'fuzzy' keyword and paragraphs without a 
translation. Once you're done you can rebuild the documentation by 
typing 'make' and send a patch bringing the po file up-to-date.


Changelog:

  * Make.rules.in
    Makefile.in
    configure.ac
    en/Makefile.in
    en/wine-faq.sgml
    en/winedev-guide.sgml
    en/winelib-guide.sgml
    en/wineusr-guide.sgml
    Makepo.rules.in
    fr/.cvsignore
    fr/Makefile.in
    fr/wine-faq.po

    Francois Gouget <fgouget at codeweavers.com>
    Add a framework to handle the translation of Wine's documentation 
using po4a.

    Romuald VIEUX
    Yvon BENOIST
    Translate and proof-read the WineFAQ to French.


-- 
Francois Gouget
fgouget at codeweavers.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wd20050512-french.diff.bz2
Type: application/octet-stream
Size: 35912 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20050512/954a205d/wd20050512-french.diff.obj


More information about the wine-patches mailing list