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:
This feature includes language keys for every Servoy menu item as well as all Servoy system information, warning and error dialogs. In addition, it also includes a complete set of locale message text for Servoy i18n system language keys in German, Dutch (Netherlands) and Italian.
Servoy provides i18n functions as part of the built-in Servoy Library, which means that one can set/get i18n message keys and values programmatically as part of a Servoy method (script).
This chapter gives a detailed view of the Servoy i18n feature and how to use it programmatically.
To enable a solution to support more than one language, the following actions need to be performed:
The i18n table can be created/chosen from an existing server, or a separate server can be created for the table to be placed in.
The i18n server and table can be selected in:
TIP: Create a single i18n database server connection and i18n table when having a solution that contains one or modules - this allows to add and/or change i18n values and/or keys from either the solution or any of the added modules. |
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:
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