- Success Criterion 3.1.2
- Conformance level AA
Language Attribute Applied to the Wrong Element Entirely
3.1.2 — Language of Parts
Scenario
Setting
A hotel booking site's room-selection page
What’s wrong
lang applied but to the wrong scope (marks the English wrapper, not the foreign phrase).
Example
A hotel booking site's room-selection page shows the problem clearly: lang applied but to the wrong scope (marks the English wrapper, not the foreign phrase).
Why it matters
Screen-reader users hearing mixed-language content with the wrong voice rules. Here, on a hotel booking site's room-selection page, the result is they hear the wrong pronunciation throughout.
How to test
Inspect the lang attribute's scope in DevTools: if it's applied to a wrapping English element instead of the actual foreign-language phrase inside it, it fails.
How to fix
The passage in another language must carry its own correct lang attribute.
Outcome
After the fix, the same visitor to a hotel booking site's room-selection page can now hear the correct pronunciation.
Who is affected
Screen-reader users hearing mixed-language content with the wrong voice rules.
Learn more
- Understanding Understanding document (opens in a new tab)
Related scenarios
- No Way to Programmatically Tell Which Language a Passage Uses
- Foreign-Language Quote or Phrase With No Language Attribute
- Language Switcher Link With No Language Tag of Its Own
- Mixed-Language Legal or Product Text Left Entirely Unmarked
- Language Attribute Copy-Pasted Onto the Wrong Piece of Text
- Bilingual Layout Where One Column’s Language Goes Unmarked