l10n@2.0: PO files and working with them
This diary entry will be the basis of the documentation for POT/PO files handling and OpenOffice.org
translation using them. Please send comments to
dev@l10n
.
OpenOffice.org comes with POT files (see
FTP server which
is mirroring my directory at
ftp.linux.cz). Download the
latest file (right now, it is
OpenOffice.org-SRC680_m63-POT.tar.gz)
and unpack it somewhere. It contains POT files (*.pot) and the file
en-US.sdf
. You
need
en-US.sdf
to
generate GSI/SDF file you can then
use while building your localized version of OpenOffice.org.
POT files contain entries like
#: sdslots.src#SID_INSERTFILE.sfxslotinfo.text
msgid "File"
msgstr ""
This particular POT entry comes from file
pot/sd/sdi.pot
. What does it mean? The
module
sd
contains directory
sdi
which contains translatable texts.
Texts to be translated are stored inside
localize.sdf
files in the source code. They
are extracted using mechanism that is still to be described (it already is implemented in my build
system, but I haven't yet described it). But anyway: it is not that important for translators,
because they only need POT files.
Back to sample POT entry: the line starting with
#:
allows people to look for the
string inside OpenOffice.org source code. This particular string comes
from
sd/sdi/sdslots.src
, and has identifier
SID_INSERTFILE
. The string
itself is "File" (see msgid). The translation it empty, because it is POT file (PO Template). PO
files look very similar, but they have msgstr line filled in with the translation.
How to generate PO files for translators from these POT files? I wrote a script called
POT2PO which can be
used for two tasks:
- generating new PO files when you are starting with the translation
- updating existing PO files to newer version of POT files
Just read its commentary section and run it. You'll end up with new/updated
po
directory with new PO files. Now you translate them,
generate GSI/SDF file and build
with it. And that's all.
If you have any questions, please ask on
dev@l10n
. Thanks for your feedback!
-----