wxLaserTank wxLaserTank

Translating Text

If you would like to translate wxLaserTank into another language, thank you. Your efforts will be appreciated by the Laser Tank community.

Translating wxLaserTank

The process is quite straightforward. Unlike the classic Laser Tank, wxLaserTank uses language catalogues. The plain text catalogues have the suffix .po. These are then compiled into a binary version with the suffic .mo. Your job is to create the plain text catalogue. Each new catalogue contains the English language words and phrases. You simply provide the translations. The easiest way to do this is using poedit. Poedit is a free catalogue editor, also written in wxWidgets and therefore available on a range of platforms. You only need to download poedit for your platform and a blank catalogue and you can get started. There are other editors and command line tools available for gettext management. If you prefer one of these, feel free to use it. The only requirement is that you can generate the .po file.

Once you have started poedit and loaded the catalogue, you will see a screen like this:

Select a word or phrase in the top window. The English version will be entered in the middle window. Enter your translated string in the bottom window. That's it. Translated phrases are moved to the bottom of the list.

Be aware of things like trailing spaces. These are much easier to see if you select "Display quotes" from the View menu. Please try to respect capitals, names and special characters such as "%s", "\t" and "&" which must remain in the translated phrase. "\t" and "&" must also remain in the same positions. Once you have translated all of the text, save and close poedit and it will create the .mo for you automatically. You will need to test your translation in the game to check for things like text that doesn't fit on existing controls. You may have to adjust your translation strings so that they fit. Then just send the .po and .mo to me for inclusion via the submission thread in the forum.

Translating Graphics

The translation pack also contains the opening and control graphics. If you'd like to translate these, you will need to edit them in a graphics manipulation programme, replacing the English strings with the appropriate translations. You can't relocate things on these graphics and you will definitely need to load them into the game regularly to check that your work sits correctly with the game sprites and other items on the screen. You might like to examine some of the graphics that have already been translated to see how that works. Please don't change the size or format of the graphics as the game will not be able to deal with them.

Testing Your Work

To see your work in the game, you just need to create a new folder for your translation in the directory called "lang" and run it. The folder must be named using the correct locale code for the language. A list of codes is provided in the translation pack but, as an example, if you are creating a French translation you would create a directory called "fr" in the "lang" directory. If your translation is for Belgian Dutch, your directory would be named "nl-BE". Again, look at the existing structure in "lang" for examples. wxLaserTank detects your system's language and loads the appropriate language files. This means that you will need to run it on a system that is set to use the language that you have translated to, in order for you to see the new text and graphics. You can change this in the Regional and Language Options applet in the Control Panel on Windows if you want to change languages for testing purposes. Alternatively, you can cheat by putting the translated files in the directory for the language that your O.S. is using. For example, if your system is using English, put them in "lang/en".

You can download the translation pack on the SourceForge files page.

Thanks in advance for your contribution.