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

Difference between revisions of "Translation guide"

From Globulation2

Jump to: navigation, search
m (typo)
 
(29 intermediate revisions by 11 users not shown)
Line 1: Line 1:
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.
__NOTOC__
This guide will explain you how the 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:
{{Warning|Warning|Although not compolsory, it is highly recommended that you use [[CVS]] 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 [[CVS]] ensures an up to date translation.}}
If you are looking for wiki's translations you may want to check this link: [[Wiki guide]].

{{Message|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==
==Some notes on tutorial and other scripted maps translation==
The documentation present here only applies to game strings, not to maps.
The documentation present here only applies to game strings, not to maps.


If you want to translate the tutorial, please download [http://cvs.savannah.nongnu.org/viewcvs/*checkout*/glob2/glob2/scripts/tutorial.sgsl tutorial.sgsl] from CVS. 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.
If you want to translate the tutorial, please download the scripts for each scenario ([http://hg.globulation2.org/glob2-new/file/default/scripts/tutorial_part1.sgsl#l1 part1] [http://hg.globulation2.org/glob2-new/file/default/scripts/tutorial_part2.sgsl#l1 part2] [http://hg.globulation2.org/glob2-new/file/default/scripts/tutorial_part3.sgsl#l1 part3] [http://hg.globulation2.org/glob2-new/file/default/scripts/tutorial_part4.sgsl#l1 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==
==Understanding the translation system==
Line 13: Line 20:
:./data/texts.list.txt - this is only a list of all known translation files; the first file is the file of keywords
:./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
:./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 respresentation 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:
*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 [[CVS]], not on the files releases.
:'''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.en.txt -- English -- Up to date, no help needed
:./data/texts.de.txt -- Deutsch -- Up to date, no help needed
:./data/texts.br.txt -- Português do Brasil -- Up to date, no help needed
:./data/texts.dk.txt -- Dansk -- 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.ca.txt -- Català -- Up to date, no help needed
:./data/texts.es.txt -- Español -- Out of date, no one working on it
:./data/texts.se.txt -- Swedish -- Up to date, no help needed
:./data/texts.it.txt -- Italiano -- Up to date, Fede is working on it
:./data/texts.tr.txt -- Turkish -- Up to date, no help needed
:./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.es.txt -- Español -- Out of date, currently got someone working on it
:./data/texts.dk.txt -- Dansk -- Out of date, no one working on it
:./data/texts.fr.txt -- Français -- Out of date, currently got someone working on it
:./data/texts.ca.txt -- Català -- Out of date, no one working on it
:./data/texts.it.txt -- Italiano -- Out of date, currently got someone working on it
:./data/texts.se.txt -- Swedish -- Out of date, no one working on it
:./data/texts.nl.txt -- Nederlands -- Out of date, currently got someone 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.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.hu.txt -- Magyar -- Out of date, no one working on it
:./data/texts.pl.txt -- Polski -- 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.ro.txt -- Româneste -- Out of date, no one working on it
:./data/texts.ru.txt -- Русский -- Out of date, no one working on it
:./data/texts.sr.txt -- Српски -- 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.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.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.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==
==Preparing for a translation==
*Most people download the latest "texts.en.txt" file from CVS 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 langugae 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.
*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..).
*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..).


Line 49: Line 56:
::* Don't try to use advanced editors like OpenOffice, it will not do the work at all!
::* Don't try to use advanced editors like OpenOffice, it will not do the work at all!
: In windows:
: In windows:
::* Notepad and Wordpad are probably not a good choice; Neither are Office or OpenOffice.
::* 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 [http://www.pspad.com/en/] with dictionaries; sorry it's not GNU.
::* Or try jEdit, PSPad, etc.
::* Or try jEdit, AceHTML, etc.
* Then, you must understand the structure of the file:
* Then, you must understand the structure of the file:
: Every line is separated with the others by the ENTER character (new line)
: Every line is separated with the others by the ENTER character (new line)
Line 59: Line 67:
* 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 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.
* 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 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!
* 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...
* You can later launch glob2 as you usually do and test how well your translation looks...
* Please read the Links to see how you can upload files to the ftp in the translation directory; please notify the developers on the forum and/or the mailing list; your translation will be integrated in the cvs and the next version of glob2 will include your translation.
* 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.


[[Category:User Manual]]
[[Category:en]]
[[Category:Contributor Resources]]
[[Category:Contributor Resources]]
[[Category:No_need_translation]]

Latest revision as of 12:45, 17 July 2010

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