improve language switch in header

This commit is contained in:
2026-01-31 15:55:11 +01:00
parent 4958982cf7
commit dc3fc0429e

View File

@@ -184,9 +184,7 @@ class AppHeader extends HTMLElement {
langDropdown.querySelectorAll('[data-locale]').forEach(btn => {
btn.addEventListener('click', async () => {
await i18n.setLocale(btn.dataset.locale)
this.closeDropdown()
this.render()
this.setupEventListeners()
// render() wird vom i18n-Subscriber in app-shell.js aufgerufen
})
})
@@ -241,8 +239,8 @@ class AppHeader extends HTMLElement {
}
updateTranslations() {
i18n.updateDOM()
this.querySelector('#current-lang').textContent = i18n.getLocale().toUpperCase()
this.render()
this.setupEventListeners()
}
}