Howto:Translate FlightGear: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Update)
(Some updates and corrections)
Line 1: Line 1:
This howto explains '''translating [[FlightGear]]''''s menus and messages to your language.  
How to '''translate [[FlightGear]]''''s menus and messages to your language.


The language option was broken in FlightGear 2.4.0 and 2.6.0. Menu translations are only supported as of 2.7.0 and later.
# Check whether your language already has a subdirectory below <tt> [[$FG_ROOT]]/translations/</tt>. The two letter language code can be obtained from the [http://www.loc.gov/standards/iso639-2/php/code_list.php ISO 639 list]. If it does exist, skip to step 2, else do the following:
 
# Check whether your language already has a subdirectory under <tt>[[$FG_ROOT]]/translations/</tt>. The two letter language code can be obtained from the [http://www.loc.gov/standards/iso639-2/php/code_list.php ISO 639 list]. If it does exist, skip to step 2, else do the following:
## Create an empty directory with your language's code.
## Create an empty directory with your language's code.
## Copy the <tt>[[$FG_ROOT]]/translations/en/menu.xml</tt> and  <tt>[[$FG_ROOT]]/translations/en/options.xml</tt> file to the directory of your language.
## Copy all files from <tt>[[$FG_ROOT]]/translations/en/</tt> to the directory of your language (e.g. "menu.xml" and "options.xml").
# Translate the English strings in your language's xml files. '''Do not''' translate the filenames!
# Translate the English strings in your language's xml files.
#* '''Do not''' translate the filenames!
#* Please do not change the order, structure or indentation of the XML files - only translate the English text content itself. This helps with future maintenance when the language resource need to be updated for another FG version, since the files can more easily be compared with the default English resource.
# Edit the file <tt>[[$FG_ROOT]]/Translations/locale.xml</tt> and add the section for your language.
# Edit the file <tt>[[$FG_ROOT]]/Translations/locale.xml</tt> and add the section for your language.
# Start FlightGear with <code>--lang=your code</code> (can be set via <tt>Advanced > General</tt>, when using [[FGRun]]).
# Start FlightGear
#* FlightGear selects the language resource based on your computer's main language setting (operations system's locale).
#* When FlightGear does not select your preferred language automatically (i.e. you have configured your machine to another language), you can explicitly select a language using the command-line switch <code>--language=<language code></code>, or, when starting via [[FGRun]], select the language at <tt>Advanced > General</tt>.
 
=== Supported Versions ===
Menu translations are only supported as of FG 2.7.0 and later.
 
=== Supported Character Sets ===
Currently, FlightGear has very limited character set support. Only plain [http://en.wikipedia.org/w/index.php?title=American_Standard_Code_for_Information_Interchange&section=5#ASCII_printable_characters ASCII] characters and its [http://en.wikipedia.org/wiki/Latin1 Latin1/ISO-8859-1] extension are supported - which covers Western European languages only (Portuguese to German, Italian to Norwegian).


=== Notes ===
However, FlightGear's GUI is currently being reworked (PLIB is ported to OSG). Once the work is complete, it should be possible to support arbitrary fonts and languages - so even Russian, Japanese, Chinese, ... fonts will be supported.
* '''WARNING:''' You can only use [http://en.wikipedia.org/w/index.php?title=American_Standard_Code_for_Information_Interchange&section=5#ASCII_printable_characters ASCII] characters for translating strings in your language.
* FlightGear has bad I18N (internationalization) support. More information at: http://www.mail-archive.com/flightgear-users@lists.sourceforge.net/msg05761.html


== Related content ==
== Related content ==

Revision as of 15:37, 6 May 2012

How to translate FlightGear's menus and messages to your language.

  1. Check whether your language already has a subdirectory below $FG_ROOT/translations/. The two letter language code can be obtained from the ISO 639 list. If it does exist, skip to step 2, else do the following:
    1. Create an empty directory with your language's code.
    2. Copy all files from $FG_ROOT/translations/en/ to the directory of your language (e.g. "menu.xml" and "options.xml").
  2. Translate the English strings in your language's xml files.
    • Do not translate the filenames!
    • Please do not change the order, structure or indentation of the XML files - only translate the English text content itself. This helps with future maintenance when the language resource need to be updated for another FG version, since the files can more easily be compared with the default English resource.
  3. Edit the file $FG_ROOT/Translations/locale.xml and add the section for your language.
  4. Start FlightGear
    • FlightGear selects the language resource based on your computer's main language setting (operations system's locale).
    • When FlightGear does not select your preferred language automatically (i.e. you have configured your machine to another language), you can explicitly select a language using the command-line switch --language=<language code>, or, when starting via FGRun, select the language at Advanced > General.

Supported Versions

Menu translations are only supported as of FG 2.7.0 and later.

Supported Character Sets

Currently, FlightGear has very limited character set support. Only plain ASCII characters and its Latin1/ISO-8859-1 extension are supported - which covers Western European languages only (Portuguese to German, Italian to Norwegian).

However, FlightGear's GUI is currently being reworked (PLIB is ported to OSG). Once the work is complete, it should be possible to support arbitrary fonts and languages - so even Russian, Japanese, Chinese, ... fonts will be supported.

Related content