Translate the GUI into another language
Work in progress!!! chriss 11:39, 7 July 2009 (CEST)
Selecting the language for an Orbiter
To select the Language for an Orbiter, use LinuxMCE Admin Website-->Wizard-->Devices-->Orbiter.
How to translate
LinuxMCE uses a smart system for translating GUI text elements. All text bits are stored in the main database as well as the translations. The text elements are picked up when generating orbiter screens. LinuxMCE selects the text elements corresponding to the language setting of the orbiter and whenever a piece of the GUI is not translated yet, it does a fallback to the English text.
To perform a translation always follow these steps:
- update your database (sqlCVS update)
- create your language if it does not exist yet
- do the translation (or parts of it)
- commit your database changes (sqlCVS commit)
Working with the database
- "Text" : Contains all text elements that are used by the GUI. The single text elements are identified by the field PK_Text
- "Language" : Defines the available languages for the GUI. The single languages consist of an identifier PK_Language and a descriptive string, e.g, "English", "German", "French"
- "Text_LS" : Contains the translated text elements which are linked to "Text" and "Language" tables via the foreign keys FK_Language and FK_Text
To work with the database you can use several programs, e.g., mysql command line client, phpmyadmin web frontend, mysql browser desktop application... I will not go into details how to work with databases here.
When creating or modifying rows of the tables make sure to never touch the fields called psc_<something>. These are part of the sqlCVS system and are handled by sqlCVS upon checkin/update etc. If you leave these fields alone MySQL inserts the default values which are just fine.
Create a new language definition
If you would like to do a translation to a currently unsupported language you first have to create a definition for that language. To do this, create a new row in pluto_main.Language with the name of the language and remember the ID PK_Language.
I suggest to use the native spelling of the language name and not the English term, e.g. use "Deutsch" instead of "German" or "Française" instead of "French" to make the selection more user friendly. chriss 11:36, 7 July 2009 (CEST)
For every term that needs to be translated (remember, there is a smart fallback system, e.g., you do not need to translate the letters for the on-screen keyboard ;)) create a new row in pluto_main.Text_LS where FK_Language has to contain the ID of your language and FK_Text has to contain the ID of the translated row from pluto_main.Text. Best way for translating is to iterate through all entries in pluto_main.Text and create the translation.
Check in translation
After successfully translating the GUI and checking in all changes please create a ticket in Trac, make it a feature_patch, name it "translation to <yourlanguage>" and give all the sqlCVS batch numbers in the description to have a developer approve the changes to the database.
Working with Designer
Designer is a software to modify the GUI of LinuxMCE. It can also be used to create new text element and the corresponding translations. TBD
The text which you see on the Orbiter is stored in the LinuxMCE_main database in the "Text" and "Text_LS" tables. Each block of text or phrase has an entry in the text table. The Text_LS table has text in the language specified.
To add a new language you need to add a new record to the Language table, and then add new records to Text_LS, with the translated version of each text blocked. It is easiest to do this in the Designer program. Designer will show you all the text blocks logically laid out in folders and categories. It is not necessary to translate the entire user interface all at once. You can translate only certain phrases and when OrbiterGen rebuilds the User Interface it will use English for any phrases that are not translated.