logo changes

This commit is contained in:
luptmoor
2026-03-02 11:29:15 +01:00
parent f61ec3741f
commit a31606c141
6 changed files with 48 additions and 6 deletions

View File

@@ -61,6 +61,19 @@ async function setLang(lang, save = true) {
}
}
/* Attribute handling (for [src], [alt], etc.) */
document.querySelectorAll("[data-i18n-attr]").forEach(el => {
const attrMap = el.getAttribute("data-i18n-attr"); // Example: "src:logo_path,alt:logo_alt"
const mappings = attrMap.split(';');
mappings.forEach(mapping => {
const [attr, key] = mapping.split(':');
if (translations[key] !== undefined) {
el.setAttribute(attr, translations[key]);
}
});
});
/* =====================================================
SERVICES EXPAND / COLLAPSE