Localization in applications enables operators using remote displays to interact with the interface in their selected language. This feature allows for defining translations in the configuration settings and applying the chosen language in the client through the @Client.Localization property or the @Client.SetLocalization method. Localization enhances the accessibility and usability of applications for a global audience, ensuring that cultural and language differences do not hinder the user experience.
Enabling this option allows these fields to be translated. For example, strings in Display will only be translated if 'Display Strings' is enabled, even if the string exists in the table.
Enable Localization (Global Solution Setting) | |
---|---|
Alarm messages | String in Alarms > Items > Message column |
Display strings | All strings in objects with Localize enabled in Draw |
System messages | System messages related. |
Import Strings Wizard | |
---|---|
Source Language | The original language of the content to be translated. (It will be used for automatic translation) |
Target Language | The language into which the content will be translated. (It will be used for automatic translation) |
Load String | Depending on what is checked in 'Enable Localization', all related fields will be automatically imported. |
Translate | All imported fields will be translated using an online service (Azure, Google, or Libre). |
You can create multiple dictionaries and switch between them at runtime by simply setting the dictionary name.
Displays Localization Configuration Table | |
---|---|
Property | Description |
ID | Identifies each localization entry uniquely. |
VersionID | Tracks the version of the localization entry. |
OriginalText | Displays the original text before translation. |
Disabled | Indicates if the localization entry is disabled. |
TranslatedText | Shows the text after translation. |
DateCreated | Records the creation date and time of the localization entry. |
DateModified | Records the last modification date and time of the localization entry. |
Description | Provides a description of the localization entry. |
You can localize the text in your application in as many languages as needed. To do this, create a dictionary for each language.
In Solution / Settings, you can define the default Culture Information that the application is using. The runtime property Client.CultureInfo
allows you to change it during runtime. Some display controls such as Calendars, may get the Culture Info directly from the Operating System. In this situation, the correct procedure is for both the Operating System settings and the solution settings to have the application's target culture. For example, to change the Culture Info to Portuguese (Brazil): @Client.CultureInfo = "pt-BR"
.
For an example on how to switch the language of a solution, check out Localization Solution. In summary, there are some things to look for when preparing your solution's localization:
Most of the components on display can be translated by changing the property @Client.Localization
or using the method @Client.SetLocalization
, as described above. If you want to translate just some strings but not all, you can use @Client.Locale method. For example, to localize a TextLabel component:
When you enable Display Strings, you don't need to use the @Client.Locale method, all strings in the display will be automatically translated. |
A dictionary named 'En_pt' was created with "Display strings" enabled. It translates the word 'Button' to 'Botão'. In the Task ClientStartup the following code is executed:
@Client.Localization = "En_pt"; |
In Draw, we have a button with the original Label Text 'Button'. However, since we used the dictionary and set a new language, it now displays 'Botão'.
In this section: