Internationalization

From GregariusWiki

Jump to: navigation, search

Contents

[edit] Supported Languages

Gregarius supports the following languages:

  • Chinese
  • Danish
  • Dutch
  • French
  • German
  • Greek
  • Hebrew
  • Hungarian
  • Indonesian
  • Italian
  • Japanese
  • Macedonian
  • Portuguese
  • Portuguese (Brazil)
  • Russian
  • Spanish
  • Swedish
  • Telugu
  • Turkish
  • Ukrainian
  • Vietnamese

[edit] Contributing a new language

NOTE: this section (and the following) only applies to Gregarius version 0.5.5 and above.

If Gregarius is not available in your language, we would love to have you translate Gregarius and contribute it to the community. Please follow these guidelines:

  1. Register for a Launchpad.net account.
  2. Select the language(s) you would like to translate Gregarius into.
  3. The selected language(s) should now be available in the Gregarius translations page
  4. Translate Gregarius into your language(s)
  5. Email Marco and ask him to import your languages into the development version of Gregarius.

[edit] Technical details

A few technical details on how Gregarius language integrates with gettext and how to get a new translation up and running.

[edit] Requirements

To translate Gregarius into a new language, without the help of Launchpad's Rosetta you'll need:

  • A fairly up-to-date build of gettext. (Win32: here, Mac OS X: get it via fink, Linux, BSD: should be pre-installed)
  • A text-editor that can handle Unicode, or:
  • A gettext-aware translating tool, such as poedit (Win32, Mac OS X) or KBabel (Linux)
  • Some basic knowledge with your favorite shell.

[edit] Roll your own translation

The actual translation process is fairly straight-forward. This step-by-step guide assumes you are in your Gregarius installation's root directory.

  1. Create a subdirectory of intl with your language's locale, for example lo:
    mkdir intl/lo
  2. Create a LC_MESSAGES subdirectory of intl/lo:
    mkdir intl/lo/LC_MESSAGES
  3. Copy the localization template to the LC_MESSAGES directory, renaming it to messages.po:
    cp intl/messages.pot intl/lo/LC_MESSAGES/messages.po
  4. Edit the intl/lo/LC_MESSAGES/messages.po file in your text-editor or translating tool: simply write the translation for each msgid token into the corresponding msgstr line.
    Note: it's ok to skip translations for some elements, they'll simply stay in english.
  5. When you're done translating, "compile" the PO file into a binary MO file:
    msgfmt -o intl/lo/LC_MESSAGES/messages.mo intl/lo/LC_MESSAGES/messages.po
  6. Check your translations: visit the home of your Gregarius installation's root, by specifying a language argument, e.g. http://your.server.com/gregarius/index.php?lang=lo
  7. When you're happy with your translation, create a new langinfo.txt file inside the intl/lo/ directory, then fill in with the following information (adapted to your own language, of course)
Language: Français
Locale: fr
Windows-locale: fra
Author: mbonetti at gmail dot com

[edit] Updating a language file

To update a partially translated language file, e.g. after new labels have been added to the POT template, run msgmerge:
msgmerge -v --update intl/lo/LC_MESSAGES/message.po intl/messages.pot.

This will append new un-translated labels to your PO file, which you can then translate as described above. Remember to re-run msgfmt as above to rebuild the MO file, after you're done translating!


[edit] External Links

Personal tools