Difference between revisions of "Localization"
(→Editing translation file: added github issue link) |
(→Editing translation file: added Better PO Editor) |
||
Line 31: | Line 31: | ||
Translation files (*.po) should be edited with specifically designed translation tools: | Translation files (*.po) should be edited with specifically designed translation tools: | ||
− | * [http://virtaal.translatehouse.org/ Virtaal] – | + | * [http://virtaal.translatehouse.org/ Virtaal] – Editor for Windows, Linux and Mac OS. |
− | * [http://poedit.net/ Poedit] – | + | * [http://github.com/mlocati/betterpoeditor/releases Better PO Editor] - Editor for Windows only. |
+ | * [http://poedit.net/ Poedit] – Discouraged, because it changes formatting of the file and produces "noise" [http://github.com/vslavik/poedit/issues/94] [http://poedit.net/trac/ticket/25]. | ||
Note: Translation files could also be edited manually using a text editor, but this is highly discouraged as tiny mistakes can result in corruption of the entire file. | Note: Translation files could also be edited manually using a text editor, but this is highly discouraged as tiny mistakes can result in corruption of the entire file. |
Revision as of 01:52, 11 August 2014
This article describes localization (translation) of applications into different languages. Please study this material carefully before attempting to contribute.
Products which currently support this new method for localization are:
- ReNamer
- (more will be added soon)
Note: Previous versions of localization articles are available for reference, but they should no longer be used: Localization Old 2013, Localization Old 2014.
Translation files
Translations are stored in PO files (as produced by gettext) are are distributed together with the application, inside Languages folder:
- Languages\Application.po – Template file.
- Languages\Application.ru.po – Russian (RU) translation file.
- Languages\Application.es.po – Spanish (ES) translation file.
- Languages\Application.fr.po – French (FR) translation file.
- ...
Template file (Application.po) is used for creating translations for new languages and normally should not be edited.
Translation files (Application.XX.po) contain translated text. A two letter country codes in the file extension to identify a particular language. All possible country codes are defined in ISO 3166-1 alpha-2.
To create a translation file for a new language:
- Create a copy of Application.po (template file)
- Rename it to Application.XX.po (translation file), where XX is a two-letter country code for the new language.
- Edit new translation file using instructions below.
Editing translation file
The process involves translation of individual textual messages to create a mapping from original text to a different language.
Translation files (*.po) should be edited with specifically designed translation tools:
- Virtaal – Editor for Windows, Linux and Mac OS.
- Better PO Editor - Editor for Windows only.
- Poedit – Discouraged, because it changes formatting of the file and produces "noise" [1] [2].
Note: Translation files could also be edited manually using a text editor, but this is highly discouraged as tiny mistakes can result in corruption of the entire file.
Guidelines for translators
Guidelines for translators:
- Try not the exceed the length of the translated text, comparing to the length of the original text.
- Some components may not fit longer text, so it is better to make it shorter rather than longer.
- Beware of the special formatting, symbols and placeholders, e.g. "\n", "%s", "%d".
- Make sure to maintain such formatting, translate only actual words.
- If you don't have a good translation for some text, just leave those blank.
- Other people may be able to fill in the blanks later.
Attribution to the translator:
- Replace "#Translator#" value with your name and it will be displayed in the About dialog of the translated application.
- If you are updating an existing translation, please keep the name of original author and append your name if you wish (comma separated).
Loading specific language
Application automatically tries to recognize system language on launch and loads appropriate translation file.
To load a specific language (translation) file, either:
- Add "--lang XX" command line parameters to the application, where XX is a two-letter language code.
- Set "LANG" environmental variable to a two-letter language code.
Publishing your translation
Please send new and updated translation files via email, as attachments.
The email address can be found in the About dialog of every application.