Create language switch
In the language switching system module, you will find a number of tasks that you need to complete in order to make your application available in several languages.
These tasks include:
Below the User texts node, you can freely organise the localizable texts of your project in text groups. Recommendation:
-
Organise the texts according to components, e.g. according to views. On the one hand, this makes it easier to find the texts in the Select localizable text dialogue; on the other hand, you benefit from this form of organisation if you use the template management functions. In template management, you can save components of your project, i.e. views or classes, as templates and insert them into another project. If localizable texts are used in these components, you can also name text groups when creating the template, the contents of which are also saved as part of the template.
Text groups can be organised hierarchically, i.e. You can create a subgroup below a text group. For example, you can encapsulate a text list in its own subgroup. A nesting depth of up to eight hierarchy levels is permitted in the User texts node.
In addition to the component-related text groups, you can also create a text group that contains the texts "OK", "Cancel", "System is busy", etc. that are used repeatedly.
The text fields of a localizable text contain limitations and additional functions:
-
A text is limited to a maximum of 255 characters. This may not always seem sufficient at first. But remember: the user must also want to read the text. A message that is too long will be clicked away too quickly by the user. If you are really forced to write some longer texts, you can combine several text modules into one text using the language switching functions. The alarm system, for example, also supports the storage of entire documents in several languages within the scope of the free parameters.
-
Localisable texts support the formatting "\n" for a line break and "\t" for a tab indentation.
-
Localisable texts support further formatting that creates text modules framed in @ characters using the Edit localizable text dialogue. Such a block can be, for example, a current variable value, a formatted date/time output or another text from the language switch.
To add a project language, double-click on the project explorer node Language switchingWConfigurationWLanguages to open the corresponding table editor and select the New entry in the context menu. Select the desired language from the list of available languages and confirm with OK. Adding a new language causes a corresponding column to be added to the tables for the localizable texts.
A language contains a numerical identifier in brackets, the so-called locale identifier (LCID). This identifier is required at runtime in the language switching calls. For example, if you want to switch to English (United States), you must use the value 1033 as a parameter in the corresponding calls.
After installation, you will find the "VisiWin Translation Manager" entry in the Windows start menu. This tool is used to export texts to be translated to Microsoft Excel and to re-import the texts after translation. You can find more information on this programme in the Translation Manager section.
Set developer language
One of the languages contained in the project can be selected as the developer language. The selection is made via the project explorer node Project configurationWGlobal in the "Language" tab.
Some definitions, such as alarms, contain references to localizable texts as parameters. The texts for the developer language are specified in the corresponding editors. Therefore, if you want to specify these texts in English rather than German in the alarm editor during project planning, you must change the developer language accordingly.