From 3269766ea7e2340a658cc13343f9d3cc6565b7dc Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Mon, 21 Oct 2019 16:03:17 +0300 Subject: [PATCH] - client: use lowercase lang codes --- client/src/i18n.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/client/src/i18n.js b/client/src/i18n.js index 9b5a5f9a..5b144110 100644 --- a/client/src/i18n.js +++ b/client/src/i18n.js @@ -51,16 +51,16 @@ const resources = { sv: { translation: sv, }, - 'pt-BR': { + 'pt-br': { translation: ptBR, }, - 'zh-TW': { + 'zh-tw': { translation: zhTW, }, bg: { translation: bg, }, - 'zh-CN': { + 'zh-cn': { translation: zhCN, }, cs: { @@ -87,7 +87,7 @@ const resources = { pl: { translation: pl, }, - 'pt-PT': { + 'pt-pt': { translation: ptPT, }, sk: { @@ -109,6 +109,7 @@ i18n .use(reactI18nextModule) .init({ resources, + lowerCaseLng: true, fallbackLng: DEFAULT_LANGUAGE, keySeparator: false, nsSeparator: false, @@ -119,10 +120,10 @@ i18n react: { wait: true, }, + }, () => { + if (!availableLanguages.includes(i18n.language)) { + i18n.changeLanguage(DEFAULT_LANGUAGE); + } }); -if (!i18n.language.includes(availableLanguages)) { - i18n.changeLanguage(DEFAULT_LANGUAGE); -} - export default i18n;