What it means
The <html> element has no lang attribute, or its value isn't a valid language tag. The tag tells software which language the page is written in: en, en-GB, de, fr-CA and so on.
Why it matters
Screen readers use the language to choose a voice and pronunciation; without it, a French page may be read aloud with English rules and become hard to follow. Browsers use it for translation offers, spelling and hyphenation, and search engines use it as a hint. WCAG 2 success criterion 3.1.1 asks for it.
How to fix it
- Open your main template or layout file.
- Add the attribute:
<html lang="en">, using the page's main language. - Use a two- or three-letter language code, optionally with a region, such as
pt-BR. - On multilingual sites, set it per page from the page's language.
- Mark passages in another language with
langon their own element.
Check it worked
Run the accessibility check again on the same address. The finding should be gone. Then try the page yourself with only the keyboard, and if you can, with a screen reader such as NVDA or VoiceOver: automated checks find only some problems.