Keep the HTML lang attribute in sync with the i18next language (#3247)

This commit is contained in:
Quentin Gliech
2025-05-05 17:12:00 +02:00
committed by GitHub
parent 8828b705d9
commit 380880137e

View File

@@ -136,6 +136,11 @@ export class Initializer {
lookup: () => getUrlParams().lang ?? undefined,
});
// Synchronise the HTML lang attribute with the i18next language
i18n.on("languageChanged", (lng) => {
document.documentElement.lang = lng;
});
await i18n
.use(Backend)
.use(languageDetector)