Friday, August 19, 2005

Useful tips from Dwayne Bailey

Subject: How to creating non-English language Po translation files

I've just been documenting how to create non-English source language
files for Mozilla and have added some info for OOo here:

Use this:

oo2po -P --source-language=fr GSI_fr.sdf french-pot

This will create .pot files with French (fr) as the source language
using GSI_fr.sdf and putting all the files into french-pot

To create a set of PO files with your translation and a different source
languages try this. Here we are creating a source language of Afrikaans
(af) and a target language of Xhosa (xh)

Take your existing SDF files

cat GSI_af.sdf GSI_xh.sdf > GSI_af-xh.sdf
oo2po --source-language=af -lxh GSI_af-xh.sdf po

Using your combined SDF file this will create PO files with Afrikaans in
the msgid and Xhosa in the msgstr and output them into a directory
called po.

To create a new SDF file after translating do the following:

po2oo -lxh -t en-US.sdf af-xh new.sdf
This uses an en-US.sdf file as a template and read po files from af-xh
placing them in new.sdf

NOTE: I checked the produced GSI file using gsicheck. But if you are
going to rely on this method I suggest a more thorough check, maybe do
it in small stages.

No comments: