Fix tooltips not being localized on load

This commit is contained in:
Misode
2019-12-19 01:02:52 +01:00
parent e2dddec691
commit f96a515d77
3 changed files with 3 additions and 9 deletions

View File

@@ -17,11 +17,11 @@ i18next
}) })
.then(() => { .then(() => {
jqueryI18next.init(i18next, $, { parseDefaultValueFromContent: false }) jqueryI18next.init(i18next, $, { parseDefaultValueFromContent: false })
$('html').localize() updateView()
}) })
function changeLng(code) { function changeLng(code) {
i18next.changeLanguage(code).then(() => { i18next.changeLanguage(code).then(() => {
$('html').localize() updateView()
}) })
} }

View File

@@ -126,6 +126,7 @@
"type": "boolean", "type": "boolean",
"default": "false", "default": "false",
"translate": "entry.expand", "translate": "entry.expand",
"help": true,
"require": [ "require": [
"minecraft:tag" "minecraft:tag"
] ]

View File

@@ -2,13 +2,6 @@ let structure;
let components; let components;
let collections; let collections;
i18next.on('initialized', () => {
$('[data-help]').each(function() {
console.log('ahhh');
$(this).tooltip({title: i18next.t('help.' + $(this).attr('data-help'))});
});
});
changeVersion('1.15'); changeVersion('1.15');
function changeVersion(version) { function changeVersion(version) {
$.getJSON('schemas/' + version + '.json', json => { $.getJSON('schemas/' + version + '.json', json => {