Fedora selinux-user-guide translation

Ruediger Landmann r.landmann at redhat.com
Sat May 23 00:56:32 UTC 2009


Paul W. Frields wrote:
> On Fri, May 22, 2009 at 09:32:12AM +0200, Gianluca Sforna wrote:
>   
>> On Fri, May 22, 2009 at 4:44 AM, Scott Radvan <sradvan at redhat.com> wrote:
>>     
>>> Hi all
>>>
>>>
>>> The SELinux User Guide for F11 is completed, is there anyone available
>>> to work on translation?
>>>       
>> I will forward this to the it_IT translation team.
>>
>> BTW, can you briefly explain how to build the guide locally? I find it
>> very useful to see the overall document structure, and having a
>> printed version is quite more comfortable to read...
>>     
>
> Install the 'publican-fedora' package (which brings in 'publican' and
> other necessary dependencies).  Then you can do 'make
> html-single-<LANG>' to make your language version.  

Before you "make html-single-it-IT" (for example), you need to make sure 
that the target language is in Publican's Makefile, or add it if it's 
not, like:

OTHER_LANGS = it-IT

There's another complication, however. Publican will look for the .po 
files for the document in a directory named for the target language, and 
will expect a separate .po file for each .xml file in the English 
version of the document. Because the current version of Transifex can 
only serve a single .po file for each document, we've had to merge these 
files together to make them available in Transifex, and they must be 
split apart again before you can make the document in Publican.

So, let's assume that you want to build a local copy of the SELinux User 
Guide in Italian:

1. Check out a copy of the source. It should have the following structure:
-- a directory named "en-US", holding the English XML files
-- a directory named "pot", holding the .pot files that correspond to 
each XML file
-- Publican's Makefile
-- a directory named po, holding a file named LINGUAS, a file named 
selinux-user-guide.pot that was created by merging together the contents 
of the pot directory, and the merged po files for various languages 
including it.po
You can see this structure clearly in, for example, the repo for the 
Fedora User Guide: 
http://git.fedorahosted.org/git/?p=docs/user-guide.git;a=tree;h=refs/heads/f11-tx;hb=f11-tx 
(ignore the es-ES directory for now)

2. add OTHER_LANGS = it-IT to the Publican makefile if it isn't already 
there (or add it-IT to this line if OTHER_LANGS is already enabled for 
languages other than Italian). You can see an example of a 
well-populated Publican Makefile in the Fedora Installation Guide here: 
http://git.fedorahosted.org/git/docs/install-guide.git?p=docs/install-guide.git;a=blob_plain;f=Makefile;hb=df349fa845ffbecaa597a4839d83c85228a63bbb

3. install the publican-fedora package (which will also pull in publican 
itself)

4. In this document's directory (that is, the folder that contains the 
Makefile and the various directories listed in step 1 above), run "make 
update-po-it-IT". This will create a directory named it-IT and a set of 
.po files ready to translate into Italian. (The es-ES directory that you 
saw in step 1 above was created in this way)

5. run the following  short script to update Publican's po files from 
the merged po file:

for POTFILE in pot/*.pot; do
        msgmerge po/it.po ${POTFILE} | msgattrib --no-obsolete \
                 > $'it-IT'/$(basename ${POTFILE} .pot).po
done

For other languages, replace "it.po" with the name of the merged po file 
for your language, and "it-IT" with the name of the Publican directory 
for your language

6. run "make html-single-it-IT" to create the document as a single html 
file. The output will appear in the tmp/it-IT/html-single directory.


On subsequent runs, you will be able to start at step 5!

Note that any XML errors introduced in the po files will stop Publican 
from building the document. You will need to find and fix the error in 
the merged po file, then run the script from step 5 to bring the changes 
into Publican's po files.

The good news is that Transifex 0.6 can handle Publican's multiple .po 
files and will therefore remove a lot of this double-handling when 
Fedora's Transifex is updated to this version :)

Cheers
Ruediger




More information about the Fedora-trans-list mailing list