QA finding
The page does not declare its language, or declares it in a form browsers cannot use
QA Error Severity: Medium
Part of the audit Language declaration. Finding id: qa.langAttribute.
What it costs you
Screen readers pick the voice and pronunciation from this attribute. Without a usable value the page is read with the wrong accent or not at all. Browsers also use it to offer translation and to hyphenate.
What to do
Set lang on the html element to the language the page is written in.
What it checks
- Page language not declared
- Page language code is not valid
How to fix it
Declare the language on the html element
How to check: View the source of the page: the html tag carries lang with the code of the page's language.
Thresholds
| Name | Default | Meaning |
|---|---|---|
well_formed_pattern | (?i)^[a-z]{2,3}(-[a-z0-9]{1,8})*$ | Shape of a language tag: a two or three letter language, then optional parts separated by hyphens. |