Skip to content

Learn

3.1.1 Language of Page

The page's main language is set in code.

Level A

What the automated checks look for

Pages have no language set

Without a page language, a screen reader may read the text with the wrong pronunciation.

Who it affects. A screen reader may read English text with a French voice, for example, which is hard or impossible to understand.

How to fix it. Set lang on the html element to the page's main language.

<html lang="en">

Pages' language codes are not valid

An invalid page language makes a screen reader guess the pronunciation.

Who it affects. A screen reader can't pick a voice for an unknown language code, so it may mispronounce every word.

How to fix it. Use a valid language code on the html element, such as "en" or "en-US".

<html lang="en-US">

Pages' lang and xml:lang differ

Two different languages on the html element leave assistive technology unsure which to use.

Who it affects. A screen reader may pick the wrong voice for the page.

How to fix it. Make lang and xml:lang on the html element the same, or remove xml:lang.

<html lang="en" xml:lang="en">

Read more