1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-24 00:35:26 +03:00

Fix errors about using i18next before its properly initial… (#1782)

Fix errors about using i18next before its properly initial…
This commit is contained in:
Michael Keller 2019-10-31 19:12:12 +13:00 committed by GitHub
commit b2cc8e0f55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View file

@ -41,7 +41,7 @@
}, },
"dependencies": { "dependencies": {
"bluebird": "^3.5.5", "bluebird": "^3.5.5",
"i18next": "^17.0.11", "i18next": "^18.0.1",
"i18next-xhr-backend": "^3.1.1", "i18next-xhr-backend": "^3.1.1",
"inflection": "1.12.0", "inflection": "1.12.0",
"jbox": "1.0.5", "jbox": "1.0.5",

View file

@ -31,17 +31,17 @@ i18n.init = function(cb) {
console.log('i18n system loaded'); console.log('i18n system loaded');
var detectedLanguage = i18n.getMessage('language_' + getValidLocale("DEFAULT")); var detectedLanguage = i18n.getMessage('language_' + getValidLocale("DEFAULT"));
i18n.addResources({"detectedLanguage": detectedLanguage }); i18n.addResources({"detectedLanguage": detectedLanguage });
i18next.on('languageChanged', function (newLang) {
i18n.localizePage(true);
updateStatusBarVersion();
});
} }
if (cb !== undefined) { if (cb !== undefined) {
cb(); 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) { i18n.changeLanguage = function(languageSelected) {

View file

@ -2484,10 +2484,10 @@ i18next-xhr-backend@^3.1.1:
dependencies: dependencies:
"@babel/runtime" "^7.5.5" "@babel/runtime" "^7.5.5"
i18next@^17.0.11: i18next@^18.0.1:
version "17.3.0" version "18.0.1"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-17.3.0.tgz#6223799605303607243ce7c4c9846b205c14cd9c" resolved "https://registry.yarnpkg.com/i18next/-/i18next-18.0.1.tgz#10841209f6983df4d8e367204da403d8cbc609cf"
integrity sha512-4sJ6CHhLu/+xOEo3wresVl7jhC92bXhBkZYigJRzXCljzlgdayNhP/+0K+76GHmFTlL/OHg/hw04Praph9SJsA== integrity sha512-KWd9qMFXw0qjxF7cTAqQselPCYoHfaLvBs8c6JcNzaQKVxbAlE/wv9EZXPy+JlKUcXCT0qgjcmxrJjmbnEp60A==
dependencies: dependencies:
"@babel/runtime" "^7.3.1" "@babel/runtime" "^7.3.1"