fix: i18n live-reload for dashboard — tabs now respect language setting
Root cause: dashboard tabs rendered via t() template literals had no data-i18n attributes, so setLocale() _applyDOM() could not re-translate them live. User switching to English in profile saw no effect without page reload. Changes: - i18n.js: expose t/initI18n/setLocale/getLocale/tr globally (window.*) for non-module script compatibility - viewer.js: add data-i18n attributes to all 4 dashboard tabs + loading text + empty state messages (12 elements total) Verified: tabs show 'Statistics/Bookmarks/Recent/Shared' in EN mode
This commit is contained in:
@@ -138,6 +138,13 @@ async function _loadLocaleStrings(locale) {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Global exports for non-module scripts (legacy app.js) ──────────────────
|
||||
window.t = t;
|
||||
window.tr = tr;
|
||||
window.getLocale = getLocale;
|
||||
window.setLocale = setLocale;
|
||||
window.initI18n = initI18n;
|
||||
|
||||
/** Walk the DOM and update every element with a data-i18n* attribute. */
|
||||
function _applyDOM() {
|
||||
// textContent
|
||||
|
||||
Reference in New Issue
Block a user