HTML lang attribute is set
Why it matters
Screen readers depend on the lang attribute to select the correct language engine for text-to-speech pronunciation. Without it, a screen reader may attempt to pronounce English content using French or Japanese pronunciation rules — producing incomprehensible audio for users who are blind or have low vision. WCAG 2.2 SC 3.1.1 (Language of Page) is a Level A requirement: the lowest, most foundational conformance level. Section 508 (2018 refresh) 504.2 also mandates language identification. A missing lang attribute is an automatic WCAG failure that makes the page non-compliant with accessibility law in the US, EU, and most jurisdictions.
Severity rationale
Medium because the impact is targeted — screen reader users bear the full cost of incorrect language detection, while sighted users are unaffected — but it represents a clear WCAG Level A failure.
Remediation
Set the lang attribute on the root <html> element with a valid BCP 47 language code:
<html lang="en">
In Next.js App Router, set it in app/layout.tsx:
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
For multi-language sites, set lang dynamically based on the current locale: lang={params.locale}. Common codes: en (English), es (Spanish), fr (French), de (German), pt (Portuguese), ja (Japanese), zh (Chinese).
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 Site Health Check 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 · 504.2 — Content Creation or Editing
Taxons
History
- 2026-04-18·v1.0.0·Initial import from site-health-check·automated