Taxipilot at

Support This Project

Chapter 6. How to translate TaxiPilot

Translating the actual application should not be different from compiling any other application. However, since all the levels are defined in seperate file that are read at runtime (and may contain language-specific strings), you should provide translations for the strings in those files, too. Here's how to do so (version 0.7.1 and above):

Somewhere in cdp.cpp there is an i18n()ed string "en_US", that you will have "translate" to your language code (e.g. "fi" or "de"). Now, whenever TaxiPilot starts parsing a configuration file, it will try to find a translations-file with the language code as a filename-extension. I.e. when TaxiPilot reads the file "level1.level", and your language code is "fr" it will look for a file called "" (in the same directory). If it doesn't find this file, all strings in "level1.level" will be used untranslated.

If TaxiPilot does find the translations file, it expects it to look like this:

some string to be translated:::::translated version of the string
another string that should be translated:::::translation for that one

I.e. you simply list those strings that should be translated, five colons and then the translated version. Order of the strings is irrelevant, but be sure to copy the left-hand-side (i.e. the not yet translated strings) exactly as they are, since otherwise TaxiPilot will not be able to match them to their translations. There is no need to translate strings, that are not shown to the user, or are the same in your language. If the translations-file does not contain a certain string of the configuration-file on the left-hand-side, the string will be used untranslated.

Although this is not exactly good style, there are a number of images that contain language-specific information (i.e. strings that are realized as graphics). Although of course, it's a lot harder to translate those, you can do so, by simply "translating" the filename of the image. I.e if the file "levelx.png" contains text, you could edit that image, save it as "" (leave the extension ".png" untouched!) and add a line

in the translations-file.

When done, you should test your translations, and especially have TaxiPilot parse all config-file thoroughly, to make sure you did not break anything (command-line option --thorough_check). In case you get unexpected results, try the command-line option --debug-level 4 , which will generate a lot of output, among other things listing all the strings TaxiPilot translated (or failed to find a translation for). A basic understanding of TaxiPilots configuration files (see previous chapter) will probably help in deciding, which strings should be translated and which should not.

Last modified: Apr 03 2005 17:51 (GMT)

SourceForge Logo