declarative `language to locale` transformation rules
- declarative
language to locale
: new section inubConfig.json
application.localization.irregularLangToLocaleMap
can contain a language to locale transformation rules. For example, by default UB consideren
language isen-GB
locale, thereforeformatByPattern.formatDate('2021-12-30', 'date')
returns30/12/2021
(dd/mm/yy), but if we define"irregularLangToLocaleMap": {"en": "en-US"}
in config, the same function will return12/30/2021
(mm/dd/yy) as in American locale. Prior to these changes, the developer had to use the JS functionformatByPattern.setLang2LocaleHook
in the model to achieve the same result -
allLocales
endpoint now combine not only/model/locale/lang-${lang}.json
files, but also/model/locale/lang-${locale}.json
. This allows to define a different localization for different locale, for example by addinglocale/lang-en-US.json
for US -
csShared.formatByPattern
will use irregularLangToLocaleMap if available on both AsyncConnection and from inside server