Skip to content

MindSphere Web Components
Internationalization

MindSphere Web Components support different locales via the locale property. They provide the locales en and de by default and allow developers to add or modify locales using the localeManager.

The localeManager provides the following methods for reading, overwriting or defining new i18n texts of MindSphere Web Components:

Member Description
getLocaleSettings(): any Returns the locale settings of the component. Use this method to determine translatable texts and check the current locale settings of the component.
addLocale(LocaleName: string, settings: any) Defines a new locale and provides an object with translated texts.

Info

The locale attribute is available for all MindSphere Web Components, but some components (e.g. Map) do not contain any translatable texts.

Example

In the following example a new locale fr is defined for the asset view and the search text is overwritten in French.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
// check the locale setting of the component
var currentLocale = assetViewComp.localeManager.getLocaleSettings();

// replace the text for "search" with the french word
var frLocale = { search: "recherche" };

// create a new locale "fr" with the updated translation
assetViewComp.localeManager.addLocale("fr", frLocale);

// change the view to the new locale
assetViewComp.locale = "fr";

ChangedLocale

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.