Translating STK

This article will explain how to translate STK into another language.

There are two main methods :

  • the first is web-based and involves using the Launchpad web interface for translations. This is now the recommended method.
  • the second is desktop based and involves using poEdit to edit the STK .po file. This method is deprecated because after you edited the file this way you would need to send it to us and then we need to update the STK file manually (whereas it's quite automatic when using Launchpad)

Online translations on Launchpad

Log in or register

To translate STK you must go to the STK project on Launchpad : [1] To translate STK, you must have a Launchpad account :

800px If you don't have a Launchpad account you can easily create one :

800px

See existing translations

After you are logging in, go back to [[2]] Don't forget to click on view all languages !

800px

Translating

Then you can start translating SuperTuxKart by clicking on the language you want.

e.g. with the Irish language :

800px

Once you have translated STK, scroll down and click on save and continue :

800px

poEdit

Installing poEdit

Note : you may use other tools but the procedure for them is not documented here
  • Get latest STK (to get all latest strings)

The directory where you need to go is /data/po. There you will see a file named supertuxkart.pot and a script called update_pot.sh. The .pot file contains all translatable strings of STK. The update_pot.sh script can be run from the base directory to update the .pot file, but you generally do not need to do that since the STK developers will do it for you.

To get the latest po subdirectory from SVN without checking out the whole SVN version, use:

svn co https://supertuxkart.svn.sourceforge.net/svnroot/supertuxkart/main/trunk/data/po/ stk_po

Configuring poEdit

  • Make sure poEdit is configured to compile .mo files on saving (check in preferences)

File:Poedit prefs.png

  • from the View memu, check Show automatic comments window. This will make a new area appear : this area will sometimes contain tips that the devs left to help you translate a string, for instance if its meaning is ambiguous.

File:Poedit comments.png

Creating a new translation

  • Open poEdit and use menu File > New catalog from POT file.

File:Poedit1.png

  • Select supertuxkart.pot.

File:Poedit2.png

  • Enter the appropriate information in the dialog that pops-up (ignore fields you do not understand or that do not make sense for this project. Only the first tab needs to be completed)

File:Poedit3.png

  • Then simply select the strings in the list and enter a translation.
  • When you're done, save the file as [language code].po. Along it, a .mo file will be generated. Move the .mo file to /data/po/[language_code]/LC_MESSAGES/supertuxkart.mo.

Testing your translation

your translation should be automatically picked if your system is set to the language you made the translation for. If your system is in english or another language, you can force a language from terminal

  • On UNIX (Linux, Mac) : export LANG=[keycode] && export LC_MESSAGES=[keycode] then ./src/supertuxkart or so. Make sure that LC_ALL is not set( or with the correct value ), since it overrides the other variables.
  • In a Windows command interpreter: set LANGUAGE=de_DE followed by .\supertuxkart.exe (that's for german, replace "de_DE" with the code if the langauge you want to test)
  • In a Cygwin shell: $ env LANG=de_DE ./supertuxkart.exe

Updating an existing translation

  • Open the language code.po file in poEdit.
  • Choose Catalog > update from POT file

File:Poedit update.png

  • Select supertuxkart.pot.

File:Poedit2.png

  • You will then get a summary of changes (new and/or obsolete strings) if any.
  • Then simply select the strings in the list and enter a translation.
  • When you're done, save the file. Along it, a .mo file will be generated. Move the .mo file to /data/po/[language_code]/LC_MESSAGES/supertuxkart.mo.