- client: use lowercase lang codes

This commit is contained in:
Ildar Kamalov 2019-10-21 16:03:17 +03:00
parent bd1ee48a4f
commit 3269766ea7
1 changed files with 9 additions and 8 deletions

View File

@ -51,16 +51,16 @@ const resources = {
sv: { sv: {
translation: sv, translation: sv,
}, },
'pt-BR': { 'pt-br': {
translation: ptBR, translation: ptBR,
}, },
'zh-TW': { 'zh-tw': {
translation: zhTW, translation: zhTW,
}, },
bg: { bg: {
translation: bg, translation: bg,
}, },
'zh-CN': { 'zh-cn': {
translation: zhCN, translation: zhCN,
}, },
cs: { cs: {
@ -87,7 +87,7 @@ const resources = {
pl: { pl: {
translation: pl, translation: pl,
}, },
'pt-PT': { 'pt-pt': {
translation: ptPT, translation: ptPT,
}, },
sk: { sk: {
@ -109,6 +109,7 @@ i18n
.use(reactI18nextModule) .use(reactI18nextModule)
.init({ .init({
resources, resources,
lowerCaseLng: true,
fallbackLng: DEFAULT_LANGUAGE, fallbackLng: DEFAULT_LANGUAGE,
keySeparator: false, keySeparator: false,
nsSeparator: false, nsSeparator: false,
@ -119,10 +120,10 @@ i18n
react: { react: {
wait: true, wait: true,
}, },
}, () => {
if (!availableLanguages.includes(i18n.language)) {
i18n.changeLanguage(DEFAULT_LANGUAGE);
}
}); });
if (!i18n.language.includes(availableLanguages)) {
i18n.changeLanguage(DEFAULT_LANGUAGE);
}
export default i18n; export default i18n;