Language & Number Format mapping

Hi,

In UX, number formatting is changed automatically when we switch the language.
Where is this mapping stored in UX?
We want to manipulate: if language is English, use Dutch format, etc

Hi @monder

Basically no such mapping of language to number format exists in Apliqo UX.

This is something where the documentation is not quite as good as it possibly could be. There are a number of control parameters in the default.constant.js file which control the number and date formatting, e.g.

'NUMBER_FORMAT': '#,###;(#,###);0;-',
'DATE_FORMAT': dateFormat,        
'THOUSANDS_SEP': thousandsSep,
'DECIMAL_POINT': decimalPoint,
'USE_BROWSER_LOCALE_AS_LOCALE': false,
'USE_SEPARATORS_FROM_LOCALE': true, 

The number format is universal for all locales (it just gets “translated”) but the thousand and decimal separators defined in the file are for the default locale (i.e. English) only unless USE_SEPARATORS_FROM_LOCALE = false. If a display language other than English is selected in UX then the number separators and date format will be picked up from the computer’s locale (Regional Settings in Windows, not sure about Mac or Linux). If USE_SEPARATORS_FROM_LOCALE = true and USE_BROWSER_LOCALE_AS_LOCALE = true then the locale settings will be taken from the browser not the computer (e.g. the currently selected display language in chrome).

This could lead to inconsistencies. For example if the user’s regional settings or browser display are set to US English but they select another language then all application captions will be translated based on the selected language but number and date formats will be English becasue that is what the locale settings are.

Yes this is a little bit inconsistent and a little bit confusing, but it does offer a solution to your issue of wanting to display Dutch captions but English number formats. To achieve this all that you need to do is have …

'USE_BROWSER_LOCALE_AS_LOCALE': true,
'USE_SEPARATORS_FROM_LOCALE': true, 

… and instruct the user to select English as the browser display language (need to close and re-open browser app if changing this setting) and Dutch as the Apliqo UX display language. The application captions will then be translated into Dutch (and model specific attribute values wherever available) but the number formats will still use comma for thousand and dot for decimal.

2 Likes

Hi @cw-ch,

Thanks for the explanation and it does cover our requirement.
Also I agree with missing documentation regarding number formatting. We experienced number formatting inconsistencies in almost every customer and spending too much time on this.
Would be great to have a seperate documentation for this.
Thanks
Muhammed