Servoy provides internationalization (i18n) tools that allow developers to conveniently convert their applications into multiple languages. Developers can use i18n keys instead of hardcoded text to call the appropriate language from an i18n database table. This chapter gives an overview of the Servoy tools provided to create internationalized solutions.
Note: In addition to the tools discussed below, Servoy provides a scripting API for commonly used functions, accessible via the i18n node towards the bottom of Solution Explorer (separate from the Resources project). This feature is discussed in the Programming Guide.
In This Chapter
The data for internationalization is saved in the workspace under the Resources project. The table is then exported with the solution when the solution is deployed to the application server (if Export i18n data is checked in the Export Wizard).
To add internationalization to a solution, an i18n table needs to be associated with the solution. A message dialog will prompt the developer to do this when first adding internationalization to a solution using either of the two available methods: (1) externalizing all the available text in a solution or (2) adding i18n messages one by one to forms/scripts.
Note: Changes made to i18n entries are locally saved to the workspace during development. The defined i18n table will then be added to the application server upon deployment of the solution.
Tip1: To change a solution's assigned i18n table at any time, select the solution in Solution Explorer to show the solution's Properties view. Then, double-click on the i18nDataSource line item in the Properties view and select the desired table from the pop-up browser that appears.
Tip2: 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.
As mentioned previously, the Externalize Strings function adds internationalization to a solution by creating a list of all the items in the active solution that are available for internationalization. It then generates i18n keys and messages from all the text properties in the solution (form objects such as button labels, column titles) and replaces the hardcoded text with the i18n keys, with the default text being the original text property that was assigned to the item.
To externalize a solution:
Internationalization can be added one by one to a solution by editing i18n keys in the i18n table using the Table Editor.
To view and edit an i18n table:
Note that the i18n keys can be sorted ascending/descending on the key, default or locale columns by clicking on the header of the desired column.
I18n messages can be added to objects in both the Form Editor and the Script Editor:
text
, toolTipText
, or titleText
properties.