ACT Rule 5b7ae0 · deprecated
HTML page lang and xml:lang attributes have matching values
This compared the lang and xml:lang attributes on the root element. Their primary subtags had to match. Screen readers once read both, and the two could disagree.
The rule has been withdrawn. W3C says it is no longer maintained and should not be used.
Why W3C withdrew this rule
W3C withdrew this one because modern screen readers no longer look at xml:lang when a lang attribute is present, whatever MIME type the page is served with.
There is nothing to do about this rule now. If a report still cites it, the tool that produced the report is running an old rule set, which tells you something useful about the tool.
The criteria it was written for
The rule named these as its conformance requirements while it stood. They have not gone anywhere, so start here and use the rules that are still maintained.
- 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 5b7ae0 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 has lang attribute A tool can check this
- 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.