The main language of the page MUST be identified correctly on the element.
If the language is not specified, a screen reader will read the page in the user’s default language, which can be very difficult to understand.
Good Example:
The language is specified accurately on the second line in the code.
Begin code:
"I say to you today, my friends, so even though we face the difficulties
of today and tomorrow, I still have a dream. It is a dream deeply rooted
in the American dream.
End code.
Bad Example: Inaccurate Language Identification
If you do not identify the language of the page, and if the screen reader is set to a different language, the screen reader will read the document with the wrong pronunciation, making it nearly impossible to understand.
Begin code:
"I say to you today, my friends, so even though we face the difficulties
of today and tomorrow, I still have a dream. It is a dream deeply rooted
in the American dream.
End code.
Description: JAWS reads the English words with a Spanish accent, making the content extremely difficult to understand.
The primary language of the page MUST be identified with a valid value on the element.
The language designation must come from a standard list of language codes, which includes en (English), fr (French), es (Spanish), and others, according to the specification. Anything else (such as lang=”English”) will not work.
List of official language codes
Some screen readers support only two-letter codes. Other screen readers support regional language codes, such as en-us (American English) or fr-ca (French Canadian).
Good Example: Language of Page with a Valid Value
The primary language of the page is specified in the html tag, which is English in this case.
Begin code:
End code.
Bad Example: Missing or Invalid Value
In this example, the lang attribute is missing entirely from the element.
Begin code:
End code.
Bad Example: Invalid Value
The value “anglais” (the French word for “English”) is not valid. The proper value in this case would be lang=”en”.
Begin code:
End code.
Identify any changes of language within the document. The lang attribute can be applied to block level elements (