From Gnash Project Wiki

Jump to: navigation, search

Internationalization is important for any project that wants to enjoy the support of non-English-speaking countries. Anyone with a good command of the target language can contribute.

This is a brief guide for anyone not familiar with the translating process.

Note: a translation does not have to be complete. Any strings you leave untranslated will simply appear in the original. Partial translations are very welcome.

Note 2: Not all strings are equally important. The GUI code is important, because it is what most people interact with. So it is fine to prioritise the most important parts and leave, for instance, the debugging messages for later.



All the translation files are to be found in the po/ directory, named with the language code followed by a .po extension (an extension no doubt chosen for its meaninglessness in other languages, particularly German).

GNU gettext works in two passes: first, the gnash.pot file is created from the source code, then the individual .po files are updated from gnash.pot. You can do all this automatically with the command:

make update-po

You will need to have gettext installed.

The po files are distributed but are rarely updated, so please use 'make update-po' before working on a translation. Otherwise you may be translating things no longer in the source code and missing important new additions.

Notes on variable substitution

Lines like this:

msgid "Timeout (%u milliseconds) while loading from url %s"

are common in Gnash. Many of these printf-style statements can be translated without difficulty, but sometimes a translation requires the variables in a different order. The way to do this is:

msgstr "url %2$s のロードがタイムアウト (%1$u ミリ秒) しました"

Where the number preceding '$' is the order of the original variable.

Gnash uses boost::format. This is compatible with printf, and most places use the well-known symbols: %d, %lu, %s, %p, %x etc. But because boost::format doesn't care what type is specified, it also provides type-neutral numerical symbols: %1%, %2%, %3%. If you see any of these, you can simply move the identifier %n% to the appropriate place. Example:

msgid "Timeout (%1% milliseconds) while loading from url %2%"

would become:

msgstr "url %2% のロードがタイムアウト (%1% ミリ秒) しました"

Translating for a Release

  1. Volunteer with an email to gnash-dev to help avoid people duplicating work (you don't have to do this - it's for your own sake).
  2. Checkout the release branch.
  3. Run 'make update-po'.
  4. Update the translation.
  5. Submit as a patch to the savannah bug tracker.
  6. To be safe, send an email to gnash-dev letting everyone know the patch is there...

Translating aids

Specialist translating software includes gtranslator, KBabel and poEdit. Of course, Vim and Emacs can also do this. Emacs can no doubt translate it for you as well. See for more information.