release: WRNexusJS 0.5.10
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@wrnexus/i18n",
|
||||
"version": "0.5.1",
|
||||
"version": "0.5.10",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
|
||||
@@ -156,7 +156,14 @@ export const I18N_RUNTIME = String.raw`
|
||||
location.reload();
|
||||
}
|
||||
function bind(root) {
|
||||
var currentLang = (window.__wireI18n && window.__wireI18n.lang) || document.documentElement.lang;
|
||||
(root || document).querySelectorAll("[data-wrn-preferences]").forEach(function (switcher) {
|
||||
switcher.setAttribute("data-current-language", currentLang);
|
||||
var currentLabel = switcher.querySelector(".wire-preferences__current-language");
|
||||
if (currentLabel) currentLabel.textContent = String(currentLang || "en").toUpperCase();
|
||||
});
|
||||
(root || document).querySelectorAll("[data-wire-lang-set]").forEach(function (n) {
|
||||
n.setAttribute("aria-pressed", String(n.getAttribute("data-wire-lang-set") === currentLang));
|
||||
if (n.__wireLangBound) return; n.__wireLangBound = 1;
|
||||
n.addEventListener("click", function () { set(n.getAttribute("data-wire-lang-set")); });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user