Difference between revisions of "Translating STK"

(Log in or register)
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
This article will explain how to translate STK into another language.
+
'''Link : [https://www.transifex.com/projects/p/supertuxkart/ SuperTuxKart home at Transifex].'''
  
There are two main methods :
+
SuperTuxKart translation is web-based and involves using the [https://www.transifex.com/projects/p/supertuxkart/ Transifex web application] for translations.
* 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 : [https://translations.launchpad.net/stk https://translations.launchpad.net/stk]
+
== Join the STK Translators Email List ==
To translate STK, you must have a Launchpad account :
+
We have a separate email list [https://lists.sourceforge.net/lists/listinfo/supertuxkart-translations SuperTuxKart-Translations], on which we post announcements important for translators. The list is extremely low traffic (2 mails in 2013). If you subscribe to this list you will be informed when we declare a string freeze in preparation for an upcoming release.
  
[[Image:Main-logout.png]]
 
If you don't have a Launchpad account you can easily create one :
 
  
[[Image:Register.png]]
 
  
== See existing translations ==
 
After you are logging in, go back to [[https://translations.launchpad.net/stk]]
 
'''Don't forget to click on ''view all languages'' !'''
 
  
[[Image:Main-languages.png]]
+
== Join the translation group ==
  
== Translating ==
+
'''Important!''' You need to join the translation group in order to be able to translate.
Then you can start translating SuperTuxKart by clicking on the language you want.
 
  
e.g. with the Irish language :
+
To join a team, first click on the language you wish to help translate for, and click on "Join group" (unfortunately, joining is not instantaneous, you will need to wait for us to approve your join request. We usually approve within 24 hours but sometimes we need some more time).
  
[[Image:Translation.png]]
+
[[Image:Transifex_join_team.jpg]]
  
Once you have translated STK, scroll down and click on save and continue :
 
  
[[Image:Translations-2.png]]
 
  
= poEdit =
+
== Starting a new translation ==
== Installing poEdit ==
 
  
* Get poEdit from http://www.poedit.net/ or from your repositories on linux.  
+
To start a translation for a language that currently does not exist, simply click on the "Request language" button.
  
<center>
+
[[Image:Transifex_request.jpg]]
{| style="background-color:#ffffcc;"
 
|'''''Note :''' you may use other tools but the procedure for them is not documented here''
 
|}
 
</center>
 
  
* 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.
+
== Translating ==
 
+
Then you can start translating SuperTuxKart by clicking on the language you want, then clicking on "Supertuxkart.pot", then clicking on "Translate now"
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)
 
[[Image: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.
 
[[Image:Poedit_comments.png]]
 
 
 
== Creating a new translation ==
 
* Create a directory with your [http://www.anglistikguide.de/info/tools/languagecode.html language code] as name.
 
 
 
* Open poEdit and use menu '''File > New catalog from POT file'''.
 
[[Image:Poedit1.png]]
 
 
 
* Select ''supertuxkart.pot''.
 
[[Image: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)
 
[[Image: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: <code>set LANGUAGE=de_DE</code> followed by <code>.\supertuxkart.exe</code> (that's for german, replace "de_DE" with the code if the langauge you want to test)
 
* In a Cygwin shell: <code>$ env LANG=de_DE ./supertuxkart.exe</code>
 
  
== Updating an existing translation ==
+
[[Image:Transifex_translate.jpg]]
  
* Open the ''language code.po'' file in poEdit.
 
* Choose ''Catalog > update from POT file''
 
[[Image:Poedit_update.png]]
 
  
* Select ''supertuxkart.pot''.
+
=== Format Strings ===
[[Image:Poedit2.png]]
 
  
* You will then get a summary of changes (new and/or obsolete strings) if any.
+
From time to time, you will meet some ''format strings '':
  
* Then simply select the strings in the list and enter a translation.
+
* <TT>%s</TT>, <TT>%i</TT>, <TT>%d</TT>: something will be inserted instead of the %x, simply add the same format strings in the translation. Note that these format strings do not specify order, so they need to appear in your translation in the same order as in the original string
 +
* <TT>%0</TT>, <TT>%1</TT>, etc.: Those are like the above ones, but are ordered (%0 is the first inserted value, %1 is the second inserted value, etc.). The advantage of those is that the translation does not need to insert the values in the same order as the original string. Note that you can use these format strings in your translation even if the original string uses the first (unordered) format string.
 +
* <TT>%1$s</TT>, <TT>%2$s</TT>, etc.: Those are like the above ones, but are ordered (%1$s is the first inserted value, %2$s is the second inserted value, etc.). %1$s is equivalent to %0, %2$s is equivalent to %1, etc. The reason this syntax is supported is simply because it's more standard than the %0 syntax described above.
  
* 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.
+
=== Special plural forms ===
 +
Some languages, such as Gaelic or Russian, require plural forms different from the English pattern. We use ''ngettext'' to handle these. You can find the definition for your language's plural forms in the [http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html Localization Guide] or in the [http://www.unicode.org/cldr/charts/26/supplemental/language_plural_rules.html Common Locale Data Repository].

Latest revision as of 20:38, 17 September 2016

Link : SuperTuxKart home at Transifex.

SuperTuxKart translation is web-based and involves using the Transifex web application for translations.


Join the STK Translators Email List

We have a separate email list SuperTuxKart-Translations, on which we post announcements important for translators. The list is extremely low traffic (2 mails in 2013). If you subscribe to this list you will be informed when we declare a string freeze in preparation for an upcoming release.



Join the translation group

Important! You need to join the translation group in order to be able to translate.

To join a team, first click on the language you wish to help translate for, and click on "Join group" (unfortunately, joining is not instantaneous, you will need to wait for us to approve your join request. We usually approve within 24 hours but sometimes we need some more time).

Transifex join team.jpg


Starting a new translation

To start a translation for a language that currently does not exist, simply click on the "Request language" button.

Transifex request.jpg


Translating

Then you can start translating SuperTuxKart by clicking on the language you want, then clicking on "Supertuxkart.pot", then clicking on "Translate now"

Transifex translate.jpg


Format Strings

From time to time, you will meet some format strings :

  • %s, %i, %d: something will be inserted instead of the %x, simply add the same format strings in the translation. Note that these format strings do not specify order, so they need to appear in your translation in the same order as in the original string
  • %0, %1, etc.: Those are like the above ones, but are ordered (%0 is the first inserted value, %1 is the second inserted value, etc.). The advantage of those is that the translation does not need to insert the values in the same order as the original string. Note that you can use these format strings in your translation even if the original string uses the first (unordered) format string.
  • %1$s, %2$s, etc.: Those are like the above ones, but are ordered (%1$s is the first inserted value, %2$s is the second inserted value, etc.). %1$s is equivalent to %0, %2$s is equivalent to %1, etc. The reason this syntax is supported is simply because it's more standard than the %0 syntax described above.

Special plural forms

Some languages, such as Gaelic or Russian, require plural forms different from the English pattern. We use ngettext to handle these. You can find the definition for your language's plural forms in the Localization Guide or in the Common Locale Data Repository.