Free and Open Source real time strategy game with a new take on micro-management

Translation guide

From Globulation2

Revision as of 12:45, 17 July 2010 by Kokolihapihvi (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This guide will explain you how the game's translations are done and help you to create a new/updated one in your language. You do not and will not need to know anything about programming to do a translation.

Note: If you are looking for wiki's translations you may want to check this link: Wiki guide.

Use the latest translation files: Although not compulsory, it is highly recommended that you use Mercurial text files instead of the ones found in releases, as two things may have happened. The one your going to translate may have already been updated. Or new labels have been added/edited, which means you'll have to update it again at a later date. Using Mercurial ensures an up to date translation.

Some notes on tutorial and other scripted maps translation

The documentation present here only applies to game strings, not to maps.

If you want to translate the tutorial, please download the scripts for each scenario (part1 part2 part3 part4) from Mercurial. Inside it, there is a special print function that takes a language code (such as en, de, ...) as second argument. Please have a look at the already done translations and contact us on the mailing list if you have any question.

Once the sgsl-files are done, they need to get copied into the maps. At the moment this is a weird task to do.


Also, some of the keys in various translation files are still English, even though they should have been translated (such as [language incomplete], the incomplete is not meant to stay in English). Be on the lookout for these.

Understanding the translation system

  • First of all you have to understand that in the data/ directory. There are many "texts.*.txt" files, two of them in particular are:
./data/texts.list.txt - this is only a list of all known translation files; the first file is the file of keywords
./data/texts.keys.txt - the file of keywords, it is not a translation, and should never be modified if you are not a developer
  • Then there is all the language translation files. They are in files called texts.LANGCODE.txt, where LANGCODE is a two letter representation of your language (for example, english is en, french is fr, german is de, spanish is es etc..). Now you have to see if the latest version of the game is not yet translated in your language or up to date. The status of each file can be found below. We try to list all current translations (19 as of April 2006); they are located each in a different file:
Note: These status's are based on the files in Mercurial, not on the files releases.
./data/texts.en.txt -- English -- Up to date, no help needed
./data/texts.br.txt -- Português do Brasil -- Up to date, no help needed
./data/texts.fr.txt -- Français -- Up to date (not committed in Mercurial, only hosted on the forum), ProgVal is working on it
./data/texts.es.txt -- Español -- Out of date, no one working on it
./data/texts.it.txt -- Italiano -- Up to date, Fede is working on it
./data/texts.ru.txt -- Русский -- Out of date, no one working on it
./data/texts.de.txt -- Deutsch -- Out of date, no one working on it
./data/texts.dk.txt -- Dansk -- Out of date, no one working on it
./data/texts.ca.txt -- Català -- Out of date, no one working on it
./data/texts.se.txt -- Swedish -- Out of date, no one working on it
./data/texts.tr.txt -- Turkish -- Out of date, no one working on it
./data/texts.nl.txt -- Nederlands -- Out of date, no one working on it
./data/texts.cz.txt -- Česky -- Out of date, no one working on it
./data/texts.hu.txt -- Magyar -- Out of date, no one working on it
./data/texts.pl.txt -- Polski -- Out of date, Zenfur is working on it
./data/texts.ro.txt -- Româneste -- Out of date, no one working on it
./data/texts.sr.txt -- Српски -- Out of date, no one working on it
./data/texts.si.txt -- Slovenščina -- Out of date, no one working on it
./data/texts.sv.txt -- Svenska -- Out of date, no one working on it
./data/texts.pt.txt -- Português -- Out of date, no one working on it
./data/texts.fi.txt -- Suomi -- Out of date, no one is working on it

Preparing for a translation

  • Most people download the latest "texts.en.txt" file from Mercurial and start from there. Its the one way to make sure everything is up to date because the english text file is always up to date. However, if you have trouble understanding english, and you can understand another language that has been translated, then you can download that file instead, although it is most likely not as up to date as the english text file.
  • To start, rename "texts.en.txt" into "texts.LANGCODE.txt", where LANGCODE is a two letter respresentation of your language (for example, english is en, french is fr, german is de, spanish is es etc..).


Starting a translation

  • First you have to find an text editor that supports the UTF-8 encoding system
If you use a linux-based operating system :
  • Try gedit; it works fine if you use the X; (gedit was originally designed for the GNOME and was tested by me to work well, but you may as well find many other editors designed for the desktop you are using right now)
  • Other editors in linux can edit text in UTF-8 format, but a simple ASCII text editor is not enough! So if you open the file with emacs, nano, nedit, or kwrite and you cannot see the special characters then don't edit the file as a simple ASCI text file
  • Don't try to use advanced editors like OpenOffice, it will not do the work at all!
In windows:
  • Notepad and Wordpad don't work; Neither are Office or OpenOffice.
  • PSPad works good and gives you also good dictionaries (I prefer humility instead of errors). Download from [1] with dictionaries; sorry it's not GNU.
  • Or try jEdit, AceHTML, etc.
  • Then, you must understand the structure of the file:
Every line is separated with the others by the ENTER character (new line)
You have many lines, they are two by two linked like this:
  • TYPE A lines: these lines look something like this: [code-name of the text]
  • TYPE B lines: these lines contain the translation of the text into one language. Even if there is no translation you have to press enter (leave the line empty)
The two last lines of the text are empty lines (two new-line characters)
  • Now you must understand that all TYPE A lines are only code-names; this means, first of all you should never try to change them, unless you are a developer; second, you should never translate what is inside, they are codes, DO NOT translate them.
  • Now please translate each TYPE B line into your language by replacing the text in English with the text in your language.
  • The Python Script check_translations.py does a few things. Execute it with "python check_translations.py" on the command line, presuming you have Python installed. The script will check all translations, and will tell of un-translated texts, texts that shouldn't be there but are, and of lines that don't match the designated format. If your translation is clean, then it will print nothing and move onto the next file. It also fills in missing texts with a blank translation, and it alphabetically sorts everything. This keeps each file and line-numbers in sync

After completing your translation

  • After you have translated the file, you should first try to test it works well on the latest version of glob2. To do that, you must place your file into the data/ directory of the game, and then edit the file "data/texts.list.txt" and add at the end of the file the line "data/texts.LANG.txt"; PS: do not add this as first line or it will not work!
  • You can later launch glob2 as you usually do and test how well your translation looks...
  • Please notify the developers on the forum and/or the mailing list; your translation will be integrated into Mercurial and the next version of glob2 will include your translation.
  • Be prepared to update your translations frequently. The Glob2 developers try not to change the text of an existing key (unless it doesn't make sense in English), in that case keep your text the same if it still makes sense in your language. However, new keys are added all of the time. Most of them are trivial, but they still need to be done.

Generating a text-shot collection of screenshots

The textshot feature in the new version of Glob2 allows for translators to generate a collection of screenshots of the various translation texts. To use it, simply run the game with -textshot <directory>. When glob is drawing text to the screen, it will generate a screenshot showing what the translation key for that text is, and where it is on the screen. This in turn can be extremely useful in finding out what keys are used where in the games GUI. You must play the game though, screenshots can not be generated if the text is never drawn to the screen. Thus it becomes important to thouroughly purge all of Glob2's menus for best results.

Misc