Difference between revisions of "Localization"
(Created page with "This article describes localization (translation) of the software into different languages. Please study this material carefully before attempting to contribute. Note: Previo...") |
|||
Line 7: | Line 7: | ||
Translations are stored in '''PO files''' (as produced by [http://en.wikipedia.org/wiki/Gettext gettext]) are are distributed together with the application, inside '''Languages''' folder: | Translations are stored in '''PO files''' (as produced by [http://en.wikipedia.org/wiki/Gettext gettext]) are are distributed together with the application, inside '''Languages''' folder: | ||
− | * <tt>Languages\Application.po</tt> | + | * <tt>Languages\Application.po</tt> – '''Template''' file. |
− | * <tt>Languages\Application.ru.po</tt> | + | * <tt>Languages\Application.ru.po</tt> – '''Russian''' (RU) translation file. |
− | * <tt>Languages\Application.es.po</tt> | + | * <tt>Languages\Application.es.po</tt> – '''Spanish''' (ES) translation file. |
− | * <tt>Languages\Application.fr.po</tt> | + | * <tt>Languages\Application.fr.po</tt> – '''French''' (FR) translation file. |
* ... | * ... | ||
− | + | Template file (<tt>Application.po</tt>) is used for creating translations for new languages and normally should not be edited. | |
+ | |||
+ | Translation files (<tt>Application.XX.po</tt>) contain translated text. A '''two letter country codes''' in the file extension to identify a particular language. All possible country codes are defined in [http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 ISO 3166-1 alpha-2]. | ||
To create a translation file for a new language: | To create a translation file for a new language: | ||
− | + | # Create a copy of <tt>Application.po</tt> (template file) | |
− | + | # Rename it to <tt>Application.XX.po</tt> (translation file), where ''XX'' is a two-letter country code for the new language. | |
+ | # Edit new translation file using instructions below. | ||
== Editing translation file == | == Editing translation file == | ||
Line 23: | Line 26: | ||
The process involves translation of individual textual messages to create a mapping from original text to a different language. | 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: |
+ | * [http://virtaal.translatehouse.org/ Virtaal] – preferred editor. | ||
+ | * [http://poedit.net/ Poedit] – alternative editor. Its use if discouraged because it changes the formatting of the file and results in large diff's. | ||
+ | |||
+ | 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. | ||
== Loading specific language == | == Loading specific language == | ||
Line 31: | Line 38: | ||
To load a specific language (translation) file, either: | To load a specific language (translation) file, either: | ||
* Set "<tt>LANG</tt>" environmental variable to a two-letter language code. | * Set "<tt>LANG</tt>" environmental variable to a two-letter language code. | ||
− | * Add "<tt>--lang XX</tt>" command line parameters to the application, where XX is a two-letter language code. | + | * Add "<tt>--lang XX</tt>" command line parameters to the application, where ''XX'' is a two-letter language code. |
Revision as of 23:00, 9 August 2014
This article describes localization (translation) of the software into different languages. Please study this material carefully before attempting to contribute.
Note: Previous versions of localization articles are still available for reference, but they should no longer be used: Localization, Localization Old.
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 – preferred editor.
- Poedit – alternative editor. Its use if discouraged because it changes the formatting of the file and results in large diff's.
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.
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:
- Set "LANG" environmental variable to a two-letter language code.
- Add "--lang XX" command line parameters to the application, where XX is a two-letter language code.