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(() => {
jqueryI18next.init(i18next, $, { parseDefaultValueFromContent: false })
$('html').localize()
updateView()
})
function changeLng(code) {
i18next.changeLanguage(code).then(() => {
$('html').localize()
updateView()
})
}

View File

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

View File

@@ -2,13 +2,6 @@ let structure;
let components;
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');
function changeVersion(version) {
$.getJSON('schemas/' + version + '.json', json => {