Adding new languages to the launcher's portfolio or helping out with translating single labels or messages is quite easy.
You only need to decide on the target language you want to translate to and find the appropriate language code for your target language.
In the following steps, <code>
will represent the associated language code for your target language <language>
.
- Copy the English labels
LabelsBundle_en.properties
to a new fileLabelsBundle_<code>.properties
insrc/main/resources/org/terasology/launcher/bundle/
- Translate everything to your target language. The property files need to be valid Java properties files (ISO 8859-1 character encoding).
- Repeat (1) and (2) for the messages in
MessageBundle_en.properties
. - Add a
settings_language_<code>=...
entry to eachLabelsBundle_*.properties
file for other languages. This is used to display the new translation in the settings. The value of this entry is the translated name of your target language (e.g., in when translating to German, the entry inLabelsBundle_en.properties
would besettings_language_de=German
, while inLabelsBundle_de.properties
it would besettings_language_de=Deutsch
. - Modify
src/main/java/org/terasology/launcher/util/Languages.java
: create a new locale, add your target language to the supported locales and select the settings label. - Add a flag icon to represent your target language in the settings menu. To do this, download the appropriate icon from the famfamfam.com icon pack into
src/main/resources/org/terasology/launcher/images/flags
(or create your own 16x11 icon!) - Add a
flag_<code>=...
entry to theImageBundle.properties
file located in the same folder as theLabelsBundle_*.properties
file you've edited previously.
To keep everything nice and clean, we advise you to use a feature branch:
git checkout master
git checkout -b <language>-translation
- Add/Change files
git commit ....
git push
- Open pull request