Skip to content
Andrew Hick edited this page Jun 6, 2023 · 6 revisions

3.1.1 Language of Page

The default human language of each Web page can be programmatically determined.

When this is applicable

Always.

Check correct language

Look at the code or use the Lang bookmarklet.

Check:

  • the html element has a lang attribute and that it's set to the correct language - in X(HT)ML it might also have a xml:lang attribute, which should have the same value
  • the language of any iframes - use the Unframe iFrames bookmarklet to open all the iframes in a new window or tab, then check their language from there
  • the language is set using a valid lang attribute (ISO 639-1 2-letter codes) - it is also valid if the value is split into a main language and a sub language, for example "en-gb" for British English or "en-us" for American English

The lang attribute does not necessarily have to match the language of the majority of the page, as long as each part is correctly marked up to meet WCAG 3.1.2 Language of Parts.

Mobile app testing

Languages cannot be reliably checked at this time for native apps.

In a browser, a screen reader will switch to the language set by the page, if it is available on the device.