$Id: gettext.txt 404 2010-04-12 20:11:46Z gerd $ 1) What are this file name extensios PO, POT, MO ================================================ PO stands for "portable object". These are text-files containing all message ids and their corresponding translations. Also there are some meta data stored in the boginning of the file. Such as the name of the bloke whoe translated it, used character set (utf-8) etc. As the PO file contains the pairs of original message id (the text as it is used in patForms' source code: the English ones) and the translated message e.g. in German. Hence one PO file contains the translation into one and only one destination language. So you need an PO file for each language. POT means PO-template which is like an empty PO file. In other words it contains all to-be-translated strings but not the translated messages. MO files are "machine objects" which are PO files in a binary format. Those binary files are actually required for translation. 2) How to extract translateable strings? ======================================== All translatable strings of the gettext domain must be listed in "data/gettext/patForms.pot". $ find patForms* -name \*.php | xgettext -f - -o data/gettext/patForms.pot 3) How can I add another language ================================= If you want to add another language - lets say Greek. Just copy the the POT to gr.po and start translating it! $ cp data/gettext/patForms.pot data/gettext/patForms/gr.po $ vim data/gettext/patForms/gr.po 4) Are there some tools to edit PO files? ========================================= As said, PO files are just text files. Therefore you can always use your favourite text-editor such as VIM. Still there are some tools that make it a lot easier PO-Edit for windows KBabel for Linux 5) The POT-file has changed and a merge with existing PO files is required. =========================================================================== To merge POT files with PO files, use "msgmerge" $ msgmerge -U data/gettext/patForms/gr.po data/gettext/patForms.pot 6) Make binary files ==================== To translate portable objects to machine objects use msgfmt msgfmt -c -v data/gettext/patForms/gr.po -o ./examples/locales/gr/LC_MESSAGES/patForms.mo