Missing Page Language Check
Description
The “Missing Page Language Check” evaluates whether the lang
attribute is present on the <html>
element.
Example outcome
I noticed that the lang attribute is missing.
Impact
- Visual Impairments: Screen readers won’t know which language to use, leading to incorrect pronunciation, jarring or unintelligible speech, or wrong voice packs (e.g., using English TTS for a Spanish page).
- Cognitive Disabilities: Tools like text simplifiers or reading aids often rely on knowing the page language. Lack of a language tag can lead to cognitive overload or misinterpretation.
- Auditory Disorders: Incorrect pronunciation increases the cognitive load required to understand spoken content.
Fixes
To address missing page language:
- Determine the language in which the page’s content is mainly presented.
- Verify which is the correct language code for that language.
- Add the language code in the
lang
attribute of the<html>
tag.