[lfs-fr] LFS Translation

Alberto Senna Dias Neto albertosdneto at gmail.com
Ven 23 Mai 21:15:40 PDT 2014

2014-05-23 20:55 GMT-03:00 MENGUAL Jean-Philippe <
jmengual at linuxfromscratch.org>:

>  Cool! Very interesting! We are planning to use this utility for all lfs
> projects, so any feedback is useful. Do you have some scripts to convers
> xml-po then po-xml-html and pdf? how do you do this?
> Regards,
> --
> Jean-Philippe MENGUAL
> Président de l'association traduc.org
> Coordinateur francophone du projet Linux From Scratch
> Animateur suppléant du groupe de travail Accessibilité de l'April
> Administrateur d'accelibreinfo
>  Hello!

I broke in peaces the makefile you showed me and I made the translation
inside each folder, this way it would be easier to find any mistakes either
done by me or by OmegaT.
This way I keep in the same folder the translated .xml, the original in
english .en.xml file and the .po file.
I intend to write a more efficient and elegant script, but at this moment
this is what I need to track errors.

So, here are the steps:

1 - Starting a new translation from a brend new checkout of the original
lfs book, enter the folder and run the following:

find . -path "./stylesheets" -prune -o -path "./bootscripts" -prune -o
-path "./udev-lfs" -prune -o -name "*.xml" | while read line; do

  echo $line

  mv $line ${line/.xml/.en.xml}
  po4a-gettextize -f docbook -m ${line/.xml/.en.xml} -p ${line/.xml/.po}

With this we end up with a xml, en.xml and a po file.

2 - Translate the po file with the tool you like, I used OmegaT because it
keeps a translation memory and it is visually friendly when compared to
poedit or virtaal (virtaal made a huge mess in the po file, in fact it
changed the original text making it impossible to apply the new translation)
To use OmegaT you have to create a project and import the .po files.
Here is a trick: When setting up the OmegaT project you can make text
segmentation at sentence level. It makes the translation more readable.
Do not use OmegaT to translate the xml file. If you do this, it will not be
possible to use the translation memory because of the xml entities that are
kept in the text. Believe me, I lost a lot of time editing my translation

3 - Once you finish the translation of a chapter inside OmegaT you generate
the translated po. Copy the translated po file that is inside the folder
target of OmegaT project and overwrite the po file initially generated.

4 - Inside the folder where you have the original en.xml, translated .po
and the xml file, run:

for i in *.po; do
  echo $i

  po4a-translate -f docbook -k 0 -m ${i/.po/.en.xml} -p $i -l ${i/.po/.xml}


This will apply the translations to the xml file, in fact it overwrites the
xml file.

5 - Edit the tag lang at the index.xml. Remember to take a look at the .ent
files, and athe the xreflabel at each chapter0?.xml.

6 - run make to build the book normally.

When updating a translation you just have to do the steps 2, 3, 4 and 6.

Take a look at: svn co

Read the file "Instruction OmegaT.txt"

After the grammatical review, I will write a more efficient script for
dealing with the po and the en.xml files. The book cannot have his mess of
files. I think it must be as clean as the original.


Alberto Senna Dias Neto
albertosdneto at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-traducfr/attachments/20140524/8fb1a83c/attachment.html>

More information about the lfs-traducfr mailing list