fix(a11y): WCAG 3.1.2 — set HTML lang attribute dynamically from locale (#39243)

Co-authored-by: Fedo Hagge-Kubat <office@aitema.org>
This commit is contained in:
Aitema-gmbh
2026-04-20 20:33:10 +02:00
committed by GitHub
parent bf7ec853fa
commit 4f2fa41f4e

View File

@@ -49,6 +49,14 @@ setupAGGridModules();
const bootstrapData = getBootstrapData();
// WCAG 3.1.2: Set the HTML lang attribute based on the current locale
// so screen readers announce the correct language for the page content.
// Normalize to BCP-47 format by replacing underscores with hyphens
// so region subtags like "pt_BR" become valid "pt-BR" rather than being dropped.
const locale =
bootstrapData.common?.locale || window.navigator.language || 'en';
document.documentElement.lang = String(locale).replace(/_/g, '-');
let lastLocationPathname: string;
const boundActions = bindActionCreators({ logEvent }, store.dispatch);