mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 00:05:22 +03:00
i18next: assign languageChanged hook after initialization
This commit is contained in:
parent
c2423badfc
commit
d2623dcb11
1 changed files with 5 additions and 5 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue