diff --git a/package.json b/package.json index fd9285eb..fd6df591 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ }, "dependencies": { "bluebird": "^3.5.5", - "i18next": "^17.0.11", + "i18next": "^18.0.1", "i18next-xhr-backend": "^3.1.1", "inflection": "1.12.0", "jbox": "1.0.5", diff --git a/src/js/localization.js b/src/js/localization.js index 05d59c91..6503d3d8 100644 --- a/src/js/localization.js +++ b/src/js/localization.js @@ -31,17 +31,17 @@ i18n.init = function(cb) { console.log('i18n system loaded'); var detectedLanguage = i18n.getMessage('language_' + getValidLocale("DEFAULT")); i18n.addResources({"detectedLanguage": detectedLanguage }); + i18next.on('languageChanged', function (newLang) { + i18n.localizePage(true); + updateStatusBarVersion(); + }); } if (cb !== undefined) { cb(); } }); }); - // This function should do the same things that the i18n.localizePage function below does. - i18next.on('languageChanged', function (newLang) { - i18n.localizePage(true); - updateStatusBarVersion(); - }); + } i18n.changeLanguage = function(languageSelected) { diff --git a/yarn.lock b/yarn.lock index 10302ed4..9bdb72c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2484,10 +2484,10 @@ i18next-xhr-backend@^3.1.1: dependencies: "@babel/runtime" "^7.5.5" -i18next@^17.0.11: - version "17.3.0" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-17.3.0.tgz#6223799605303607243ce7c4c9846b205c14cd9c" - integrity sha512-4sJ6CHhLu/+xOEo3wresVl7jhC92bXhBkZYigJRzXCljzlgdayNhP/+0K+76GHmFTlL/OHg/hw04Praph9SJsA== +i18next@^18.0.1: + version "18.0.1" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-18.0.1.tgz#10841209f6983df4d8e367204da403d8cbc609cf" + integrity sha512-KWd9qMFXw0qjxF7cTAqQselPCYoHfaLvBs8c6JcNzaQKVxbAlE/wv9EZXPy+JlKUcXCT0qgjcmxrJjmbnEp60A== dependencies: "@babel/runtime" "^7.3.1"