logo changes
This commit is contained in:
13
js/script.js
13
js/script.js
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user