| 1 |
$Id$ |
|---|
| 2 |
|
|---|
| 3 |
1) What are this file name extensios PO, POT, MO |
|---|
| 4 |
================================================ |
|---|
| 5 |
|
|---|
| 6 |
PO stands for "portable object". These are text-files containing all message ids |
|---|
| 7 |
and their corresponding translations. Also there are some meta data stored in |
|---|
| 8 |
the boginning of the file. Such as the name of the bloke whoe translated it, used |
|---|
| 9 |
character set (utf-8) etc. |
|---|
| 10 |
|
|---|
| 11 |
As the PO file contains the pairs of original message id (the text as it is used |
|---|
| 12 |
in patForms' source code: the English ones) and the translated message e.g. in |
|---|
| 13 |
German. Hence one PO file contains the translation into one and only one |
|---|
| 14 |
destination language. So you need an PO file for each language. |
|---|
| 15 |
|
|---|
| 16 |
POT means PO-template which is like an empty PO file. In other words it contains |
|---|
| 17 |
all to-be-translated strings but not the translated messages. |
|---|
| 18 |
|
|---|
| 19 |
MO files are "machine objects" which are PO files in a binary format. Those |
|---|
| 20 |
binary files are actually required for translation. |
|---|
| 21 |
|
|---|
| 22 |
2) How to extract translateable strings? |
|---|
| 23 |
======================================== |
|---|
| 24 |
|
|---|
| 25 |
All translatable strings of the gettext domain must be listed in |
|---|
| 26 |
"data/gettext/patForms.pot". |
|---|
| 27 |
|
|---|
| 28 |
$ find patForms* -name \*.php | xgettext -f - -o data/gettext/patForms.pot |
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
3) How can I add another language |
|---|
| 32 |
================================= |
|---|
| 33 |
|
|---|
| 34 |
If you want to add another language - lets say Greek. Just copy the the POT to |
|---|
| 35 |
gr.po and start translating it! |
|---|
| 36 |
|
|---|
| 37 |
$ cp data/gettext/patForms.pot data/gettext/patForms/gr.po |
|---|
| 38 |
$ vim data/gettext/patForms/gr.po |
|---|
| 39 |
|
|---|
| 40 |
4) Are there some tools to edit PO files? |
|---|
| 41 |
========================================= |
|---|
| 42 |
|
|---|
| 43 |
As said, PO files are just text files. Therefore you can always use your |
|---|
| 44 |
favourite text-editor such as VIM. Still there are some tools that make it a |
|---|
| 45 |
lot easier |
|---|
| 46 |
|
|---|
| 47 |
PO-Edit for windows |
|---|
| 48 |
KBabel for Linux |
|---|
| 49 |
|
|---|
| 50 |
5) The POT-file has changed and a merge with existing PO files is required. |
|---|
| 51 |
|
|---|
| 52 |
To merge POT files with PO files, use "msgmerge" |
|---|
| 53 |
|
|---|
| 54 |
$ msgmerge -U data/gettext/patForms/gr.po data/gettext/patForms.pot |
|---|
| 55 |
|
|---|
| 56 |
|
|---|