mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-28 01:08:47 +00:00
Fix tooltips not being localized on load
This commit is contained in:
4
i18n.js
4
i18n.js
@@ -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()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"
|
||||||
]
|
]
|
||||||
|
|||||||
7
view.js
7
view.js
@@ -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 => {
|
||||||
|
|||||||
Reference in New Issue
Block a user