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