Latest Posts

Changes in TranslatingWidelands

Editor Comment

Added more glossary instructions


Revision Differences of Revision 20

# Translating Widelands ¶

[TOC] ¶

**Note: we will soon move our translations to Transifex. Please have a look at our [new translation project](https://www.transifex.com/projects/p/widelands/) there. We are updating the instructions already, but DON'T TRANSLATE ON TRANSIFEX YET.** We will remove this notice and post an annoucnement once the translations on Transifex are live. ¶

We use [Transifex](https://www.transifex.com/projects/p/widelands/) to do our translation work, which is a specialized online platform. All translation work is done in your web browser and everybody can contribute translations in any language in seconds. However, you can also download the translation files and work in an offline tool if you prefer to work that way. Transifex also offers a [Glossary](https://www.transifex.com/projects/p/widelands/glossary/) function to help you keep consistency. ¶


## Becoming a Translator ¶

If you are new to Widelands, we recommend that you play the game first. Have a look at the tutorials and at the campaigns for all three tribes and, if a (partial) translation is already available, play both in English and in your language. Check out our [Downloads](https://wl.widelands.org/wiki/Download/) page to get a free copy of the game. Once you are familiar with Widelands, these are the steps you need to take: ¶

1. Visit our project on [Transifex](https://www.transifex.com/projects/p/widelands/). You might need to get an account first. ¶
2. Look for your language on the list. If it isn't there, use the "Add language" button. ¶
3. Click on your language, then on "Add Members" and invite yourself as a translator. This step is needed so you will receive important announcement about the project via Transifex. ¶

We recommend that you take your time to become familiar with the structure of the project, and that you browse any existing translations and the glossary. If you should need further help or wish to discuss a term, please use our [Translation & Internationalization Forum](http://wl.widelands.org/forum/forum/12/). ¶


## Working with the Glossary ¶

### Accessing the Glossary ¶

Transifex offers a [Glossary](https://www.transifex.com/projects/p/widelands/glossary/) function, which we will be using from now on. However, we still have the old [Translation Dictionaries](https://wl.widelands.org/wiki/TranslationDictionary/) available as an archive - beware of obsolete entries and translations though! ¶

There are two ways to access the glossary on Transifex: Via the "Glossary" button on the [Project Overview](https://www.transifex.com/projects/p/widelands/), or while translating - glossary items will be underlined with a dotted line, and the entry and a link displayed on the bottom. ¶

### Creating new
tTerms ¶

Only create a new term if it is a core term, e.g. a worker or building name, or a menu button. Make sure that you add a short, relevant comment to it for everybody, e.g. "Production Building - Atlanteans" or "GUI". Also make sure that the spelling is exactly as in the translation file, otherwise it won't get a dotted line in the translation interface. ¶

If the new term you're adding replaces an older, obsolete term, **DO NOT DELETE THE OLD TERM**! Other translators or languages might still make use of their older translation to help them translate the new term. Document the change with a comment, like this: ¶

Old Term | New Term ¶
------- | -------- ¶
**Foo** | **Bar** ¶
OBSOLETE. Use Bar | Category X. Formerly Foo ¶

If it's only a spelling change, e.g. from `Armour` to `Armor`, just update the spelling.

### Creating new Translations in the Glossary or editing Glossary entries ¶

Before you translate a glossary entry, please search the existing translations to check if it has already been translated. Before you add your translation to the glossary, make sure that a different term hasn't already been translated the same way. ¶

Since searching the glossary is only possible for English, we recommend that you download the glossary for your language - this will give you a *.csv* file, which you can open with any spreadsheet software like !LibreOffice Calc, Microsoft Office or Google Docs. Be aware though that you can't upload this again, so any changes will need to be done through the web interface. ¶

You can use our language's comment field for any translation specific comments, e.g. grammatical information or documenting alternative translation ideas. ¶



## How the translations are organized ¶
In some cases, you wish to find a specific string of text, either because it has not been translated yet, or you want to improve the current translation/fix a typo. The translation templates are split up rather logically, so as long as you know where to look, you'll most likely find it. The following descriptions of the various templates are partially based on a [question asked on Launchpad](https://answers.launchpad.net/widelands/+question/149790). ¶

Template | Description ¶
------- | -------- ¶
widelands | Contains everything not covered elsewhere, including all menus, options, error messages, buttons, dialogs and other things in the game. If it is something which does not seem to fit in any of the other templates, it is most likely located here. ¶
maps | Names and descriptions of maps which are shown when selecting which map to play. ¶
tribe-* | Names and descriptions of wares, workers and buildings (including help texts) for the tribe. ¶
scenario-tutorial* | The tutorials available from the main menu ¶
scenario-* | The history/dialog in the campaigns. They are numbered like the order they appear in, and identified by atl (atlantean), emp (empire) or bar (barbarian) prefix before the number. ¶
world | The trees, stones, creatures etc. on the map. ¶
win-conditions | Description of the various types of games and messages with "you have won/lost" ¶
texts | Includes the README, credits, the hints shown when loading the game, and similar things. ¶
map-plateau.wmf | The story for "The green plateau", a scenario. ¶
mp-scenario-* | Text used in the multiplayer scenarios, identifiable by name. ¶
scenario-dummy.wmf | The placeholder map informing the player that no further maps/campaigns exists. ¶
tribes | Texts common to all tribes. **NOTE:** These translations can't be shown in the game yet. ¶
widelands-console | Console/Command line messages shown when "widelands --help" is called. ¶



###An example ¶
Say for instance if you are playing the second mission in the barbarian campaign and notice some typo in the story text. Then it would would make sense to search in scenario-t02.wmf, since that contains all translations for the second map in the barbarian campaign. ¶


## Plural forms ¶

Our translation system (gettext) supports the use of proper plural forms. What do we mean by that? Let's take an example word - "cat". In English, we have: ¶

* "0 cats", "1 cat", "2 cats", "3 cats", ... ¶

This gives us a singular form for 1 and a plural form for all the rest, including 0. However, not all languages behave like this. For example in Scottish Gaelic, we have: ¶

* "0 cat", "1 chat", "2 chat", "3 cait", ... ¶

So, we have 4 different forms here! Therefore, gettext will present me with 4 different forms to translate for Scottish Gaelic, where there are only 2 in the English source language strings. ¶

If you aren't sure which plural form is which for your language, check out the [Localization Guide](http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html). Let's have a look at an example on how to read the rules there. First, look for your language's code. Let's say you're translating into Czech, this will be the rule for *cs* then: ¶

*nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;* ¶

Code | Meaning ¶
------- | -------- ¶
nplurals=3 | This language has 3 plural forms ¶
(n==1) ? 0 | The first form is for the number 1 (programmers like to count from 0 instead of from 1, so it has the ID 0) ¶
: (n>=2 && n<=4) ? 1 | The second form (ID 1) is for the numbers 2 - 4 ¶
: 2; | The third form (ID 2) is for all the rest ¶

If you need help with this, please don't hesitate to ask on the [forum](https://wl.widelands.org/forum/forum/12/). ¶


## How to deal with changes in the source language ¶

Because we're still in Alpha, it can happen that we need to break some of your translations. Sometimes, it is just a matter of a fixed typo, but Launchpad will kill your translations anyway. Sometimes, we can have pretty big changes, although we do our best to avoid them. There are two ways to deal with this: ¶

### Using an offline translation tool ¶

We highly recommend that you use an offline translation tool if you plan to translate a sizeable chunk or to work on this project continuously. The two most common tools that we can recommend are [Virtaal](http://virtaal.translatehouse.org/) and [Poedit](http://poedit.net/). They both work fine - pick the one you prefer. Launchpad offers you to download / upload a file when you're in the translation view, so you will get the files to translate from there. ¶

These offline tools come with a translation memory, which means that they will remember all the translations that you have saved, ever. So, if a file with a slightly changed source text comes along, the tool will show you a suggestion and also mark the differences. This is also convenient for translating strings that are similar - we have a number of those in the project, especially with the tribes. The tool will help you keep consistency with your translations and also reduce the amount typing that you need to do. ¶

### Accessing older versions of your translation on Launchpad ¶

If you haven't been using an offline tool, you can still access previous versions of your translation. For this, you will need to ¶

* [browse the revision history](http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/changes) of the code. ¶

* Use the "<< Newer" / "Older >>" links on the bottom to navigate to a date, then click on the name of the revision you wish to access. ¶

* Click on "browse files at revision <number>" ¶

* In the "Filename" column, click on "po" ¶

* Select the translation template and then the file with your language code, e.g. "maps" and "de.po" for the German translation of the "maps" template. ¶

* If you don't fancy reading the source code version of the file, click "download file" on the top right. You will then need to get an offline translation tool like [Virtaal](http://virtaal.translatehouse.org/) and [Poedit](http://poedit.net/) if you haven't already installed one.