Localization
mobile app supports multiple languages, significantly enhancing its market presence, user engagement, and overall success by appealing to a broader and more diverse audience. The real power of the localization functionality lies in using a single that can have multiple translations associated with the , the app respects the language setting of the device and renders the in that language if the corresponding language file is found or defaults to English.
In every property that accepts string-based values, e.g., field labels, can be localized. Wherever TextLocale pops up in IntelliSense, the value can be localized. The localization to the TextLocal is specified in the Translation folder in a file for each language.
Configuring TextLocale is simple, and the translation can be:
- Invoke IntelliSense next to the property you want to translate.
- Select TextLocale
- Provide an id: for the value to be translated.
- Optional: add the defaultMessage: property with a value. If there is no translation found for the active device's language, it will either fallback to the specified defaultMessage or if one is not specified, to English.
Once the unique id has been set for the TextLocale, the file containing the translation needs to be configured:
- In under the translations folder, create a new file. The file's name must be the ISO 6391-1 codes, for example, de.jigx for German, or fr.jigx for French.
- For multiple languages create a separate file per language required.
- If you using multiple languages, simply use the same unique identifiers (id) values in each language file and for static values ensure the translated text corresponds.
To set the TextLocal property dynamically
- Invoke IntelliSense next to the property you want to translate.
- Select TextLocale
- Provide an id: and values properties. The values property requires context variables that will be used in the translation file.
- Optional: add the defaultMessage: property with a value. If there is no translation found for the active device's language, it will either fallback to the specified defaultMessage or if one is not specified, to English.
Once the unique id has been set for the TextLocale, and the values configured the file containing the translation needs to be configured:
- For multiple languages create a separate file per language required.
- Add the context variable for the values specified in the . This can be values you add to the TextLocale: value option and ICU Message definitions.
- If you using multiple languages, simply use the same unique identifiers (id) values in each language file and for static values ensure the translated text corresponds.
The following examples with code snippets are provided: