Displays Localization (Reference) enables multi-language support for HMI applications, allowing runtime language switching with automatic translation of display strings, alarm messages, and system text.
Localization provides:
Enable different text elements for translation based on application requirements.
| Setting | Translates | Location |
|---|---|---|
| Alarm Messages | Alarm text | Alarms → Items → Message |
| Display Strings | UI text | Display objects with Localize enabled |
| System Messages | Platform messages | System dialogs and prompts |
Enable at Displays → Localization → Enable Localization
| Field | Description | Example |
|---|---|---|
| Source Language | Original language | English |
| Target Language | Translation target | Portuguese |
| Load Strings | Import enabled strings | All checked items |
| Translate | Use online service | Azure/Google/Libre |
csharp
// Method 1: Direct assignment
@Client.Localization = "EN_PT";
// Method 2: Using method
@Client.SetLocalization("EN_ES");
// Check current dictionary
string current = @Client.Localization;The web client (HTML5) does not run the ClientStartup task, in FrameworX 10.1.5 and in 10.1.6. To select the dictionary on both the Rich Client and the web client, set @Client.Localization in the DisplayOpening method of the startup display's code behind:
public void DisplayOpening()
{
@Client.Localization = "EN_PT";
} |
In FrameworX 10.1.6, the selected dictionary then applies on both clients to display text, Client.Locale lookups and the runtime's own messages. Display text marked for localization also needs Displays strings enabled in Displays → Localization → Enable Localization.
csharp
// Set culture for formatting
@Client.CultureInfo = "pt-BR"; // Portuguese (Brazil)
@Client.CultureInfo = "en-US"; // English (US)
@Client.CultureInfo = "de-DE"; // German (Germany)Configure default at Solution → Settings → Culture Info
| Property | Description | Type |
|---|---|---|
| ID | Unique identifier | Auto |
| OriginalText | Source string | String |
| TranslatedText | Target translation | String |
| Disabled | Skip translation | Boolean |
| DateCreated | Creation timestamp | DateTime |
| DateModified | Last edit time | DateTime |
| Description | Translation notes | String |
When Display Strings enabled:
For selective translation:
csharp
// Translate specific string
string translated = @Client.Locale("Original Text");
// In display binding
<TextBlock Text="{Client.Locale('Hello World')}" />Components requiring special handling:
ComboBox Items:
csharp
public void LocalizeComboBox(ComboBox combo)
{
foreach(var item in combo.Items)
{
item.Text = @Client.Locale(item.Text);
}
}DataTable Headers:
csharp
public void LocalizeTable(DataTable table)
{
foreach(DataColumn col in table.Columns)
{
col.Caption = @Client.Locale(col.Caption);
}
} ? Display Strings
? Alarm Messages
? System Messagescsharp
// In DisplayOpening of the startup display (Rich Client and web client)
@Client.Localization = "EN_PT";The ClientStartup task also selects the dictionary on the Rich Client, but the web client (HTML5) does not run it. See Web Client below.
csharp
// US Format: 3/15/2024
@Client.CultureInfo = "en-US";
// European: 15/03/2024
@Client.CultureInfo = "fr-FR";
// ISO Format: 2024-03-15
@Client.CultureInfo = "invariant";csharp
// US: 1,234.56
@Client.CultureInfo = "en-US";
// European: 1.234,56
@Client.CultureInfo = "de-DE";Text not translating:
Wrong formatting:
Missing strings:
Layout issues:
csharp
// Load dictionary from database
DataTable dict = @Dataset.Query.Translations.SelectCommand();
@Client.LoadDictionary(dict);csharp
// Try primary, then fallback
string text = @Client.Locale("Key") ??
@Client.Locale("Key", "EN") ??
"Default Text";