Fail

The page doesn't declare its language

The short version

Add lang to the <html> element, such as lang="en".

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

  1. Open your main template or layout file.
  2. Add the attribute: <html lang="en">, using the page's main language.
  3. Use a two- or three-letter language code, optionally with a region, such as pt-BR.
  4. On multilingual sites, set it per page from the page's language.
  5. Mark passages in another language with lang on 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.