lang on inline content must be a valid tag
Rule
valid-lang· Document, language & navigation · impact moderate · Static + live
Why it matters
Phrases in another language need a correct lang so AT switches pronunciation. A malformed tag is ignored. Only elements whose subtree contains text are checked (a bad lang with nothing to pronounce has no 3.1.2 impact); well-formed private-use (x-…) and grandfathered (i-…) BCP-47 tags are accepted.
How to fix
Set a valid lang on the element wrapping the foreign-language passage.
Example
<span lang="francais">Bonjour</span>
<span lang="fr">Bonjour</span>
Example
<span lang="en_US">Hello</span>
<p lang="x-lojban">coi rodo</p>
Private-use (x-…) and irregular grandfathered (i-…) tags are well-formed BCP-47; underscores are not.
WCAG success criteria
3.1.2 Language of Parts — Level AA
Passages in a different language need their own lang attribute.
Standards
This rule contributes to the following standards:
WCAG AA EN 301 549 Trusted Tester ACT
| Standard | Criteria |
|---|---|
| EN 301 549 | 9.3.1.2 |
| Trusted Tester v5 | 11.b |
| ACT (WCAG SC) | 3.1.2 |