- Success Criterion 3.1.1
- Conformance level A
Language Attribute Set to an Invalid or Malformed Value
3.1.1 — Language of Page
Scenario
Setting
A survey tool's question builder
What’s wrong
Invalid values: lang="english", lang="EN-UK", region codes malformed beyond recognition.
Example
This shows up on a survey tool's question builder: invalid values: lang="english", lang="EN-UK", region codes malformed beyond recognition.
Why it matters
Screen-reader users who need correct pronunciation, and tools that depend on language metadata. Here, on a survey tool's question builder, the result is they hear the wrong pronunciation throughout.
How to test
Check the html lang value against the ISO language code list: values like "english" or malformed region codes ("EN-UK") are invalid and fail.
How to fix
The <html> element must carry a valid lang attribute matching the page language, updated when the site language switches.
Outcome
After the fix, the same visitor to a survey tool's question builder can now hear the correct pronunciation.
Who is affected
Screen-reader users who need correct pronunciation, and tools that depend on language metadata.
Learn more
- Understanding Understanding document (opens in a new tab)
Related scenarios
- Page Published With No Language Declared in the Code
- HTML Element Missing Its Language Attribute Entirely
- Page’s Declared Language Not Matching Its Actual Content
- Language Switcher That Doesn’t Update the Page’s Lang Attribute
- Language Attribute Set on the Body Instead of the HTML Root
- Multilingual Site Serving Every Locale With the Same Lang Value