From f96a515d77c991812a9e19a42e774bc622d0364e Mon Sep 17 00:00:00 2001 From: Misode Date: Thu, 19 Dec 2019 01:02:52 +0100 Subject: [PATCH] Fix tooltips not being localized on load --- i18n.js | 4 ++-- schemas/1.15.json | 1 + view.js | 7 ------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/i18n.js b/i18n.js index d379e9d3..faee506f 100644 --- a/i18n.js +++ b/i18n.js @@ -17,11 +17,11 @@ i18next }) .then(() => { jqueryI18next.init(i18next, $, { parseDefaultValueFromContent: false }) - $('html').localize() + updateView() }) function changeLng(code) { i18next.changeLanguage(code).then(() => { - $('html').localize() + updateView() }) } diff --git a/schemas/1.15.json b/schemas/1.15.json index 06461363..cb512856 100644 --- a/schemas/1.15.json +++ b/schemas/1.15.json @@ -126,6 +126,7 @@ "type": "boolean", "default": "false", "translate": "entry.expand", + "help": true, "require": [ "minecraft:tag" ] diff --git a/view.js b/view.js index cc4bcb93..6b892c2e 100644 --- a/view.js +++ b/view.js @@ -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 => {