start grid
This commit is contained in:
@ -45,8 +45,7 @@ function getStorageKey(lgid) {
|
||||
return `res_${lgid}`;
|
||||
}
|
||||
|
||||
async function doRefreshLgres(template) {
|
||||
template ??= '';
|
||||
async function doRefreshLgres(template = '') {
|
||||
const lgid = getCurrentLgId();
|
||||
const r = await get(`language/${lgid}${template}`);
|
||||
const dict = await r.json();
|
||||
@ -81,7 +80,6 @@ function getLanguage(lgres, key, defaultValue) {
|
||||
}
|
||||
|
||||
function applyLanguage(dom, result) {
|
||||
dom ??= document.body;
|
||||
for (let text of dom.querySelectorAll('[data-lgid]')) {
|
||||
const key = text.dataset.lgid;
|
||||
if (text.tagName === 'INPUT') {
|
||||
@ -100,8 +98,7 @@ function applyLanguage(dom, result) {
|
||||
}
|
||||
}
|
||||
|
||||
async function init(dom, options) {
|
||||
options ??= {};
|
||||
async function init(dom = document.body, options = {}) {
|
||||
const lgid = getCurrentLgId();
|
||||
let lgres = localStorage.getItem(getStorageKey(lgid));
|
||||
let result;
|
||||
|
Reference in New Issue
Block a user