12.07.2015 Views

free openSS

free openSS

free openSS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

44 ❘ FREE/OPEN SOURCE SOFTWARE: LOCALIZATION2. Create the PO file for your language from the template, either by copying it to “xx.po” (wherexx is your locale language) and filling its header information with your information, or by usingthe msginit utility.3. Translate the messages by editing the PO file with your favourite text editor. Some specializededitors for PO files, such as kbabel and gtranslator, are also available.4. Convert the PO file into MO file using the msgfmt utility.5. Install the MO file under the LC_MESSAGES directory of your locale.6. When the program develops, new strings are introduced. You need not begin from scratchagain. Rather, you extract the new PO template with the xgettext utility as usual, and then mergethe template with your current PO with the msgmerge utility. Then, you can continue by translatingthe new messages.GNOME intltoolGNU/Linux desktops have more things to translate than messages in C/C++ source code. The systemmenu entries, lists of sounds on events, for example, also contain messages, mostly in XML formats thatare not supported by GNU gettext. One may dig into these individual files to translate the messages, butthis is very inconvenient to maintain and is also error prone.KDE has a strong policy for translation. PO files for all KDE core applications are extracted into a singledirectory for each language, so that translators can work in a single place to translate the desktop withouta copy of the source code. But in practice, one needs to look into the sources occasionally to verify theexact meaning of some messages, especially error messages. This already includes all the messagesoutside the C++ sources mentioned above.GNOME comes up with a different approach. The PO files are still placed in the source under the “po”subdirectory as usual. But instead of directly using xgettext to extract messages from the source, theGNOME project has developed an automatic tool called intltool. This tool extracts messages from theXML files into the PO template along with the usual things xgettext does, and merges the translationsback as well. As a result, despite the heterogeneous translation system, what translators need to do isstill edit a single PO file for a particular language.The use of intltool is easy. To generate a PO template, change the directory to the “po” subdirectory andrun:$ intltool-update –-potTo generate a new PO file and merge with existing translation:$ intltool-update xxwhere xx is the language code. That is all that is required. Editing the PO file as usual can then begin.When PO editing is complete, the usual installation process of typical GNOME sources will automaticallycall the appropriate intltool command to merge the translations back into those XML files before installing.Note that, with this automated system, one should not directly call the xgettext and msgmerge commandsany more.The following sites and documents provide more information on KDE and GNOME translation:KDE Internationalization Home (i18n.kde.org/)❍ The KDE Translation HOWTO(i18n.kde.org/translation-howto/)The GNOME Translation Project (developer.gnome.org/projects/gtp/)❍ Localizing GNOME Applications(developer.gnome.org/projects/gtp/l10n-guide/)❍ How to Use GNOME CVS as a Translator(developer.gnome.org/doc/tutorials/gnome-i18n/translator.html)PO EditorsA PO file is a plain text file. This can be edited, using a favourite text editor. But, as stated earlier, translationis a labour-intensive task. It is worth considering some convenient tools to speed up the job.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!