Translating OpenOffice

OpenOffice.org uses its own system for translation called GSI files.  These are
one large text file with all the languages designated by their country dialing
code.  The file is tab separated and not really usable on it own.

Using dialing codes is a stupid idea but this is set to change in version 2.0
when the project will begin using ISO language codes.

The translate.org.za project uses the oo2po tool from its translate toolkit to
convert the GSI file into more useful PO files.

Converting OO to PO

1) Get the en_US GSI file (or an existing GSI file for your language):

Without generating it yourself - which requires the
source code of OpenOffice.org the best bet is to download it from:

ftp://ftp.linux.cz/pub/localization/OpenOffice.org/devel/GSI/

This will most likely contain the latest development GSI files for all
languages

TODO: Creating your own GSI from sources.

2) Convert to PO format

This last step takes the downloaded GSI file and converts it into PO Template files 
which can be translated using a PO editor.

oo2po -P [GSI file] [POT dir]

Where [GSI File] is the GSI file that you downloaded and [POT Dir] will contain the new POT files.
(Note: the GSI file must have the extension .gsi or .txt or .sdf)

2a) Converting an existing translated GSI file to PO

In addition to the en_US GSI file in 1) also download the GSI file contains you
language. Firstly simply combine the two GSI files.

  cat GSI-en_US GSI-your-lang > GSI-combined

Then extract your translations into a correctly formated PO file:

  oo2po -l 1,NN [Combined GSI file] [PO Dir]
 
NN - is the language number for your language, this should be column 10 of the
tab delimited GSI file.  e.g.  English US is 1, Afrikaans is 27, etc. (quickly 
lookup your number here: http://l10n.openoffice.org/languages.html)
 
[Combined GSI File] is the file that you created by joining en-US to your
language
[PO Dir] will contain PO files with both the English and your translated
strings.
 

Converting PO to OO/GSI

To merge them back, use a command as follows:
po2oo -l 27 -i po-translations/ -o oo-newtranslations.gsi -t oo-originaltranslations.gsi

where 27 is the language number for 1.x or the language code (af) for 2.x,
po-translations is the directory of the po files, and oo-originaltranslations.gsi is the original oo-file.gsi

then you will have the new GSI file in oo-newtranslations.gsi