ACT Rule b5c3f8
HTML page has lang attribute
A screen reader picks its pronunciation from the page's lang attribute. Without one it guesses, and English read aloud in a French voice is close to unusable. This rule checks the attribute is there and not empty.
A tool can decide this one on its own, which is why it turns up in scanner output. The rule is approved, which in W3C's process means it was implemented in full by at least one tool or methodology and then signed off by a working group. Approval is a statement about tools, not a statement that this is the settled way to test the criterion.
What passing this rule proves
When this rule fails, 3.1.1 Language of Page is not satisfied, and that half is certain. When it passes, W3C's own outcome mapping says the criterion still needs further testing. So a green result here is evidence that one specific thing is not broken, and it is the answer W3C gives on 59 of its 87 live rules.
Present is all it checks. lang="xyz" passes this rule and fails the next one along. Two further rules cover whether the tag is valid and whether it matches the language the page is actually written in, and it is that last one that clears the criterion.
The criteria this rule is a test for
These are the criteria the rule names as its own conformance requirement. Each one is a far bigger question than this rule asks, and our page for it sets out what the whole criterion covers.
- 3.1.1 Language of Page Level A
The normative rule text lives at W3C
What the rule applies to, and exactly what it expects, is published by W3C and can change. We link to it rather than restate it, so nothing here can quietly fall out of date against the source. Read rule b5c3f8 at W3C.
The page must declare what language it is in
A screen reader picks its pronunciation rules from the language the page declares. Get it wrong and English is read with French rules, or the other way round. The result is not slightly off. It is unintelligible.
The declaration has to be a real language tag. A passage in another language has to say so on the element that contains it.
The default in a template is the usual culprit. A site translated into German keeps lang="en" from the starter. Every page is read aloud in English pronunciation rules, making it incomprehensible.
Fixes that satisfy it
If this rule fails on your site, these are the techniques that put it right.
Other rules W3C files under the same criteria
Each of these asks a different question about the same part of the standard. Passing all of them is still not the same as satisfying the criterion.
- HTML page lang attribute has valid language tag A tool can check this
- HTML page language subtag matches default language A tool can check this
All 87 ACT rules are grouped by the criteria they test, and 24 of them decide nothing about WCAG on their own. Run a free scan to see which of these your own pages trip.