Remove language normalization - use original language

Otherwise `pt-PT` is replaced by `pt`, but they have different translations.
This commit is contained in:
Dmitry Lyzo 2021-10-26 22:27:27 +03:00
parent aa418cbf41
commit 3badb21b00
2 changed files with 12 additions and 24 deletions

View file

@ -60,7 +60,7 @@ const dateLocales = (locale) => ({
})[locale];
export function getLocale() {
return dateLocales(globalize.getCurrentLocale()) || enUS;
return dateLocales(globalize.getCurrentLocale()) || dateLocales(globalize.getCurrentLocale().replace(/-.*/, '')) || enUS;
}
export const localeWithSuffix = { addSuffix: true, locale: getLocale() };