X-Git-Url: https://git.r.bdr.sh/rbdr/forum/blobdiff_plain/a7cf03c192470cbab13edeb1aec99e0c66dede10..e8fcef96681425d431d03fa323747d7d6e61257c:/src/lib/i18n.ts?ds=sidebyside diff --git a/src/lib/i18n.ts b/src/lib/i18n.ts index 5dd533a..5f7eda1 100644 --- a/src/lib/i18n.ts +++ b/src/lib/i18n.ts @@ -6,7 +6,11 @@ import es from './translations/es.json'; addMessages('en', en); addMessages('es', es); +const fallbackLocale = 'en'; +const browserLocale: string = getLocaleFromNavigator(); +const initialLocale = browserLocale ? browserLocale.replace(/-[A-Z]{2}$/, '') : fallbackLocale; + init({ - fallbackLocale: 'en', - initialLocale: getLocaleFromNavigator().replace(/-[A-Z]{2}$/, '') + fallbackLocale, + initialLocale });