Internationalization
Support of multiple languages, also known as the standard i18n ('i' + 18 letters in 'nternationalizatio' + 'n'), is a Servoy feature that enables developing solutions that:
- Do not require additional forms or elements to display more than one default language.
- Can display multiple languages based on locale references.
Definition
Inside Servoy Developer the message files are stored as property files in the workspace.
On the server these messages are loaded in an i18n table, the i18n table which can be specified in the solution settings, it needs to have the following columns:
- tableName_id (primary key, integer)
- message_key (i18n key, string)
- message_language (i18n language, string)
- message_value (i18n value, string)
Solutions Using Multiple Languages
To enable a solution to support more than one language, the following actions need to be performed:
- Select an i18n database server connection.
- Assign or create an i18n table to store multiple language keys.
- Create the i18n language keys that will be used or edit any of the language keys included in Servoy.
Selecting i18n Database Connection and i18n Table
The i18n Server can be selected in:
- The solution Properties view: i18nDataSource property - select an existing table in a server or create one in the Select i18n table dialog.
- The Internationalization preferences in the Servoy Developer Preferences dialog - go to Window > Preferences > Servoy > Internationalization.
Usage
On Servoy elements it is possible to use a text reference, which is a key linked to a message file. Which is replaced at runtime with the localized text from the message file.
An example of an element text reference is: i18n:hello_world
Which is looked up in the messages file and produces the text in a locale like 'hello world' or 'hola mundo' in Spanish