Interface translation

From Unknown Horizons - Wiki

Jump to: navigation, search

This article explains how to see your translated po files ingame. It assumes you use a git clone of UH. All paths are, unless specified otherwise, relative to this clone's master directory. You might need to replace python calls by python2, python2.6 or python2.7.

Input
one or more .po files that contain translated strings
Download from pootle:
  • click on the speech in the overview
  • click on the project (Unknown Horizons: Interface for example)
  • click on Translate tab
  • There is the download button
Output
bytecode .mo files in Folder.png content/lang/ which can be selected in our settings as language
  • Move all pofiles into the directory Folder.png po/. The appropriate language code as filename needs to be preserved.

Now choose one path:


A Unix / Mac

  • In the main UH directory (where File.png setup.py is located) run
    user@pc: unknown-horizons
    python ./setup.py build_i18n
    • Do this whenever you edited a .po file
    • On Arch Linux: use python2 instead of python

B Win

  • In the main UH directory (where Folder.png development/ is located) run
    user: unknown-horizons
    python ./development/compile_translations_win.py
    • Do this whenever you edited a .po file

  • Now the updated files File.png content/lang/($language)/LC_MESSAGES/unknown-horizons.mo should reside in Folder.png unknown-horizons/.
  • If the language was not available before, you might need to edit the LANGUAGENAMES dict in File.png horizons/constants.py and add a description for the new language there. Please also report this or create a patch in case we forgot it.
Personal tools
Summer of Code 2012