- Do not concatenate translatable strings
- In some languages words change their form depending on context. Expecting, that several words, translated to other language and put together, will result in grammatically correct statement in that language and will be as meaningful as in original language is doomed to failure.
- Typically there is one phrase to translate with one result. As in some language phrase might be different depending on context, it's not possible to translate it properly.
- Separate phrases are difficult to translate (remember, translators don't see your code).
- Exception: in case you enforce some text format, it might be convenient to provide different parts separately, such as <what happened>: <explanation>.
- Use plural forms
- The number of plural forms is different in different languages. While English has two (singular and plural), some other languages have more. Having statement like '%d error(s)' is impossible to translate properly to some languages, so that it would be correct in all possible cases.
- Avoid assumptions on width of resulting text
- When text gets translated to other language, it's difference in width from original is unlimited. The other language might miss a word for direct translation and use a short phrase instead.
- A statement of few short words in one language may be a statement of more and much longer words in the other.
- If you do restrict, comment it, so that translators are aware of this.
- Expect the different formats
- Number and date formats are different in different locales.
- Currency symbol is placed before or after the number depending on locale.
- Do add comments for translators
- Translators typically don't see the code.
- It's difficult to translate, when you don't know the meaning of phrase, where and in what context it is used.
- When a string is parametrized, provide the meanings of parameters, '%s is %s' - which parameter is what?
2011 m. balandžio 28 d., ketvirtadienis
How to make translatable software
As a software translator myself, I sometimes face difficulties, when translating software to Lithuanian language. For this reason I've collected the following guidelines for software developers.