The lang attribute on <html>
One attribute decides which voice a screen reader uses to read your page. What it affects, what a wrong value sounds like, and how to set it.
What it is
The lang attribute on the <html> element declares the document's primary language, as a BCP 47 tag: lang="en", lang="en-GB", lang="pt-BR". This check reads the served HTML and fails when the attribute is missing or empty.
It reads the raw markup rather than a rendered page, so it runs on every scan whether or not a rendering engine was available.
Why it matters
A screen reader picks its pronunciation rules and voice from this attribute. Without it, the software guesses — usually from the user's system locale — and English prose read by a synthesiser configured for German is not slightly degraded, it is unintelligible.
It also drives quieter things: which dictionary the browser spell-checks against, which quotation marks CSS generates, and whether a translation offer is even made. One attribute, set once per document, and none of it is recoverable by any amount of work elsewhere.
How to fix it
with a reference doc<html lang="en">
<!-- a passage in another language marks itself -->
<blockquote lang="fr">Tout est pour le mieux…</blockquote>Related checks
4This is one of the 75 checks the scanner runs. See what we check for the full list, every severity weight, and how the score is computed from them.