Translating STK

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

  • Get poEdit from http://www.poedit.net/ or from your repositories on linux. (you may use other tools but the procedure for them is not documented here)
  • Get STK version 0.5rc1 or better

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.

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

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

File:Poedit prefs.png

  • Then simply select the strings in the list and enter a translation.
  • Or translate the strings by copying and pasting it from Babel Fish.
  • 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.
  • Then translate the following strings.
  • To test, export LANG=[keycode] then run SuperTuxKart (on Unix systems)

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.