From 2fc96cb6a7c4231e5513bd4b6832239d3468378f Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 17 Oct 2021 14:01:15 +0200 Subject: [PATCH] fix: change the ui locale --- src/i18n/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/i18n/index.js b/src/i18n/index.js index c922846c..a6c6ba30 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -21,14 +21,15 @@ export const availableLanguages = { const loadedLanguages = ['en'] // our default language that is preloaded const setI18nLanguage = lang => { - i18n.locale = lang + i18n.global.locale = lang document.querySelector('html').setAttribute('lang', lang) return lang } export const loadLanguageAsync = lang => { + console.log(lang, i18n.global.locale) // If the same language - if (i18n.locale === lang) { + if (i18n.global.locale === lang) { return Promise.resolve(setI18nLanguage(lang)) }