Language attribute
What it checks
AI agents use the lang attribute to select the correct language model and tokenizer when processing your content. Without it, agents may misinterpret content language, leading to poor translations or incorrect answers in multilingual AI systems.
Why it matters
User agents read the lang attribute on <html> to programmatically determine the page’s natural language. Screen readers select pronunciation rules from it, visual browsers select scripts and characters, and media players select captions. A page without it cannot have its language programmatically determined, and fails WCAG 2.2 SC 3.1.1.
Evidence
- WCAG 2.2 SC 3.1.1 (Level A), W3C Recommendation of 12 December 2024: “The natural language of each web page can be programmatically determined.” — w3.org/…/WCAG22 (verified 2026-08-21)
- Documented consumer behavior: “Screen readers can load the correct pronunciation rules”, “Visual browsers can display characters and scripts correctly”, “Media players can show captions correctly” — w3.org/…/language-of-page.html (verified 2026-08-21)
- W3C i18n guidance names
<html lang>as the required declaration mechanism: “you should always declare the language of the text in a page using a language attribute on thehtmltag” — w3.org/…/qa-html-language-declarations (verified 2026-08-21) - Same source rules out the fallback the audit does not currently consult: “You should never use a
metaelement with thehttp-equivattribute set toContent-Languageto indicate the language of a page” — w3.org/…/qa-html-language-declarations (verified 2026-08-21)
Limits
Google Search explicitly ignores this attribute for language determination: “We don’t use any code-level language information such as lang attributes, or the URL… Google uses the visible content of your page to determine its language” — developers.google.com/…/managing-multi-regional-sit… (verified 2026-08-21). No LLM vendor documents the audit’s stated mechanism (selecting a “language model and tokenizer” from lang); OpenAI’s crawler documentation mentions no HTML metadata — developers.openai.com/…/bots (verified 2026-08-21). The grade rests on the accessibility/i18n consumer path, not on an AI-specific one; the audit’s description and guidance.impact should be restated accordingly.
Note also that the standard is satisfied by a valid BCP 47 tag, which the current presence-only check does not verify — an invalid or wrong lang still fails SC 3.1.1 while scoring 1.0 here.
How it scores
Ratified W3C Recommendation (WCAG 2.2, SC 3.1.1 Language of Page, Level A) plus WHATWG HTML, with named consumer classes whose behavior W3C documents explicitly.
Sources
- WCAG 2.2 — W3C, spec (verified 2026-08-21)
- Understanding SC 3.1.1: Language of Page (WCAG 2.2) — W3C Web Accessibility Initiative, spec (verified 2026-08-21)
- W3C i18n — declaring language in HTML — W3C, spec (verified 2026-08-21)
- Managing multi-regional and multilingual sites — Google, vendor-doc (verified 2026-08-21)
- OpenAI crawlers and user agents — OpenAI, vendor-doc (verified 2026-08-21)