3.1.1 Language of Page
This document provides information about the related accessibility checks:
lang attribute(s)The human language of the page must be declared in the code of the page.
When the human language of your content is correctly declared, it allows software to accurately present your content.
This check affects the following users who have:
Translation needs: Translation software provides automated translations of your content.
No impairments: Search engines can more accurately show your content to the relevant people because it understands the language of your content. Browsers may not render text content accurately if the language of the web page is not declared correctly.
Maria, a Norwegian carpenter with dyslexia:
"When I go online to read user manuals for some of the machinery I use, they are written in English but my text-to-speech software will read the English text with a Norwegian voice. That makes it very hard for me to understand the instructions."
Follow these steps to repair this issue.
Locate the opening HTML tag at the beginning of your webpage.
Add the lang attribute to the HTML tag, followed by a valid two or three letter language code to the opening <html> element.
In the following example code, the lang value is set to en for English:
<html lang="en">For XHTML, both lang and xml:lang must be set to the same value.
<html xml:lang="en" lang=”en”>For languages that are written from right to left, the “dir” attribute should be added to the HTML element to ensure proper text directionality. This example shows the "lang" attribute set to "ar" for Arabic and the "dir" attribute is set to "rtl".
<html lang="ar" dir="rtl">In order to repair issues flagged by this check, refer the issue to:
Front-end Development. (HTML knowledge is needed.)
This section gives links to resources that help with the issues discussed in this document.
WCAG success criterion 3.1.1 Language of Page (W3C website)
ISO 639 specification (a list of valid language codes)
Internationalization techniques
If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.