From 6cbfe7e7553e62ff6f55f2693bec5638db3d53ad Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 29 Jul 2026 16:39:58 +0000 Subject: [PATCH] Sync console document lang with i18next locale Static lang=\"en\" in index.html left French UI declared as English for assistive tech. Mirror the compliance portal by updating document.documentElement.lang on init and when the locale changes. Signed-off-by: Cursor Agent Co-authored-by: Bryan FRIMIN --- apps/console/src/lib/i18n/i18n.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/console/src/lib/i18n/i18n.ts b/apps/console/src/lib/i18n/i18n.ts index 55e612d07..bdee98390 100644 --- a/apps/console/src/lib/i18n/i18n.ts +++ b/apps/console/src/lib/i18n/i18n.ts @@ -29,6 +29,12 @@ import { resolveLanguage, SUPPORTED_LANGUAGES } from "./resolveLanguage"; // react-i18next's hooks read from, so no I18nextProvider is required. const i18n = createInstance(); +function syncDocumentLanguage(language: string) { + document.documentElement.lang = language; +} + +i18n.on("languageChanged", syncDocumentLanguage); + void i18n .use(globBackend) .use(initReactI18next) @@ -42,6 +48,9 @@ void i18n ns: [DEFAULT_NAMESPACE], interpolation: { escapeValue: false }, react: { useSuspense: true }, + }) + .then(() => { + syncDocumentLanguage(i18n.language); }); export { i18n };