From The Mana World
Revision as of 09:54, 6 August 2007 by Silene (talk | contribs) (The part for translators)

Translations in The Mana World are handled by the gettext system. This page presents an overwiew in the context of the game. Please refer to the manual for additional details.

Gettext for users

Translations are supposed to work out-of-the-box. If they are not, complain to the maintainer of your binary package. This section is dedicated to users compiling tmw themselves.

When configuring, the script should tell you that Native Language Support (NLS) is enabled. It just requires the presence of gettext on your computer. From there, just compile and install like you usually do, and it should work just fine. You just need to have properly set up your system with respect to locales. If console applications, e.g. man, are translated, then The Mana World will also be.

Note that the install part is mandatory for gettext to work. You cannot run the program from your compilation directory and expect it to be translated. Here is a work around:

 ./configure --localedir=$PWD/locale    # plus your special options
 make                                   # compile as usual
 cd po ; make install                   # whenever your .po file is modified

Gettext for translators

When creating a translation for a not yet supported language, get the identifier of your language, as defined by ISO 639. It is usually two letter long. Let us suppose it is xy. Copy the po/tmw.pot to po/xy.po, and add xy to the po/LINGUAS file. That is all.

Now you can use your favorite text editor to modify the po/xy.po file. There are also a few dedicated editors. For example, gtranslator in Gnome and kbabel in KDE. The .po format is simple: on one msgid line, you read the original English sentence, on the next msgstr line, you write your translation.

From time to time, modifications to the English strings will be merged to your .po file. When it happens, translate the new empty entries, and modify the old entries marked as fuzzy. Then submit the new file.

Sentences containing percent characters (especially when preceded by the c-format comment) need special care. They start special sequences that ends with a letter. The game will replace them by words (%s) or numbers (%d) or some other things. As a consequence, their order need to be strictly respected in order not to crash the game. If respecting the order makes it impossible to translate in your language, you can use positional markers instead:

 #, c-format
 msgid "%s owns %s in one language"
 msgstr "%2$s is owned by %1$s in another language"

Gettext for developers

Gettext for translation manager