Localization
Jigx 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 Jigx localization functionality lies in using a single jig that can have multiple translations associated with the jig, the app respects the language setting of the device and renders the jigin that language if the corresponding language file is found or defaults to English.
How it works
In Jigx Builder 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.
Only one translation file per language is used, For example, de.jigx for German will hold all the TextLocal id values for all jigs in the solution that must be localized.

In the Jigx App under Profile>Settings>Language check that the setting Device is selected. This respects the settings of the device and if a matching language translation file is present in the solution the jig will show in that language.
Configuration
Configuring TextLocale is simple, and the translation can be:
Static - Add localization to a jig using a unique identifier with translated text
Dynamic - Add localization to a jig using ICU Message definitions
Adding dynamic values in localized jigs use ICU message definitions. Try it in the Online ICU Message Editor or see the ICU format messaging documentation.
Static values - In the jig
Invoke IntelliSense next to the property you want to translate.
Select
TextLocaleProvide 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 specifieddefaultMessageor if one is not specified, to English.
Static values - In the translation file
Once the unique id has been set for the TextLocale, the file containing the translation needs to be configured:
In Jigx Builder 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.
Add the unique identifiers (
id) values specified in the jig, with the corresponding translated text in the new file.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.
Dynamic values- In the jig
To set the TextLocal property dynamically
Invoke IntelliSense next to the property you want to translate.
Select
TextLocaleProvide an
id:andvaluesproperties. 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 specifieddefaultMessageor if one is not specified, to English.
Dynamic values - In the translation file
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 unique identifiers (
id) values specified in the jig, with the corresponding translated text in the new file.Add the context variable for the values specified in the jig. This can be values you add to the
TextLocale: valueoption 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.
Considerations for dynamic values
Dealing with spaces
The select clause is case-sensitive, avoid using spaces.
If your datasource has spaces you can add an entry for the translation variable that removes the space. In the code example below an entry
translation_stringhas been added to facilitate spaces.
Be consistent when key names, for example, if you use underscore (_) then ensure all spaces are replaced with underscores.
Create a fallback for the variable. The fallback in the code example below is the
othercase. This means if thetitlevariable is notcash_payment, the stringPayment placeholderwill be displayed.
Using conditions
When an expression or value of a property is configured with a condition, the condition needs to be defined in the translation file, see the code example below.
Examples and code snippets
The following examples with code snippets are provided:
Last updated
Was this helpful?