1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-19 06:15:11 +03:00

Merge branch 'master' into ToshihiroMakuuchi/ja-fix01

This commit is contained in:
Sensei 2024-12-13 17:44:16 -06:00 committed by GitHub
commit 5f25766fbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 6549 additions and 73 deletions

View file

@ -10,7 +10,8 @@ const i18nextXHRBackend = require('i18next-xhr-backend');
const Store = require('electron-store');
const store = new Store();
const availableLanguages = ['en', 'ja', 'uk'];
const availableLanguages = ['en', 'ja', 'uk','zh_CN'];
const i18n = {};
@ -173,6 +174,11 @@ i18n.localize = function (reTranslate = false) {
const element = $(this);
element.attr('placeholder', translate(element.attr('i18n_placeholder')));
});
$('[i18n_lang]').each(function() {
const element = $(this);
element.attr('lang', translate(element.attr('i18n_lang')));
});
} else {
$('[i18n]:not(.i18n-replaced)').each(function() {
@ -234,6 +240,13 @@ i18n.localize = function (reTranslate = false) {
element.attr('placeholder', translate(element.attr('i18n_placeholder')));
element.addClass('i18n_placeholder-replaced');
});
$('[i18n_lang]:not(.i18n_lang-replaced)').each(function() {
const element = $(this);
element.attr('lang', translate(element.attr('i18n_lang')));
element.addClass('i18n_lang-replaced');
});
}
return localized;