Multilingual Management

Applications and processes implement a multilingual label manager in the ‘ctx.labelManager’ object:

  • English, French and German are provided by default, and other languages can be added later.

  • English is the default language.

In order to manage all labels in a centralized manner, it is recommended to use the label manager for all projects, including monolingual ones.

Define Labels

Some labels are pre-defined when creating the project (standard buttons, ‘About’ popup, ‘Close’ popup, etc.):

Labels can be added on any application or process by using ctx.labelManager.set() method.

For mono-language projects, you can use simplified declarations without specifying the language:

Select the Current Language

The current language can be selected by using the ctx.labelManager.setLanguage() method.

To change the language on all the applications, use a loop on the ‘ctx.app’ object (application container).

Use Labels

To use labels in the code, just type the object name (with IntelliSense help):

Add a Supplementary Language

A new language can be added by using the ctx.labelManager.addLanguage() method. The new language must be declared in all applications in which labels are managed.

The new language must be added to existing labels:

New labels can be added in the languages required:

Automatically Select the Current Language

A language can be automatically detected by checking a label value. If the label value exists, the corresponding language is already defined and can be used as the current language.

Ask the User to Select the Current Language

The user can be asked to select the current language. Once selected by the user (via a popup), the information is stored in the HKCU registry and restored at each time Desktop Agent restarts.