Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions superset-frontend/src/views/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading