Default language is specified
Why it matters
The lang attribute on the <html> element tells screen readers which language to use for pronunciation. Without it, a French-language site read by VoiceOver defaults to the user's system language — French words get English pronunciation rules and become unintelligible. WCAG 2.2 SC 3.1.1 (Language of Page) is a Level A requirement. It is a one-line fix that has an outsized impact on all non-English content and multilingual applications.
Severity rationale
Low because the `lang` attribute is a one-attribute fix with zero functional impact beyond screen reader pronunciation, but its absence violates WCAG 2.2 SC 3.1.1 at Level A for every user who depends on synthesized speech.
Remediation
Add a valid BCP-47 language code to the root <html> element. In Next.js App Router, set it in app/layout.tsx.
// app/layout.tsx
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en"> {/* or 'fr', 'de', 'ja', 'pt-BR', etc. */}
<body>{children}</body>
</html>
)
}
For multilingual applications, also set lang on individual content sections when the language changes mid-page:
<blockquote lang="fr">Liberté, égalité, fraternité</blockquote>
Confirm the value is a valid BCP-47 tag (e.g., en, en-US, zh-Hant-TW) — not an ISO 639-2 three-letter code or a locale string like en_US.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Accessibility WCAG Compliance Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- wcag:2.2 · 3.1.1 — Language of Page
- section-508:2018-refresh · 501.1 — Scope
Taxons
History
- 2026-04-18·v1.0.0·Initial import from accessibility-wcag·automated