You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- MUST - must be addressed to be WCAG 2.0 AA compliant! SHOULD - is an accessibility best practice+ CONSIDER - things to think about to improve inclusive design and accessibility
Description
The HTML document element MUST contain a valid lang attribute or must correspond to a valid lang code for multilingual screen reader users who may prefer a language other than the default.
Disabilities Affected
Blind
Deafblind
Cognitive
Potential fix
Add a lang attribute to the html element (e.g. ) whose value represents the primary language of document.
Make sure you identify a language in the opening element and spell the attribute correctly. For example, if the primary language of a document is English, you could specify the language as follows:
<htmllang="en"><!--document head and body--></html>
If you would like, you can even specify some dialects with codes such as "en-US" to signify American English or "fr-CA" for Canadian French. You can find a list of language and dialect codes on the internet.
If the language changes within a document, you can specify this as follows:
<p>Text in one language <spanlang="es">text in another language</span></p>
If you are using a language that is written right to left, be sure to specify this using the dir attribute:
<plang="ar" dir="rtl">Arabic text here</p>
If you would like to specify that a language is written left to right, you can fill the value of the dir attribute with the value "ltr".
Success criterion
3.1.1 Language of Page: The default human language of each Web page can be programmatically determined. (Level A)
Why it matters
When configuring a screen reader, users select a default language. If the language of a webpage is not specified, the screen reader assumes the default language set by the user. Language settings become an issue for users who speak multiple languages and access website in more than one language. It is essential to specify a language and ensure that it is valid so website text is pronounced correctly.
Screen readers use different sound libraries for each language, based on the pronunciation and characteristics of that language. Screen readers can switch between these language libraries easily, but only if the documents specify which language(s) to read and when. If the language is not specified, the screen reader reads the document in the user's default language, resulting in a strange accent! It is impossible to understand anything when screen readers are using the wrong language library.
Severity: Serious — WCAG 2.0 (A): MUST
Feedback Framework
Description
The HTML document element MUST contain a valid lang attribute or must correspond to a valid lang code for multilingual screen reader users who may prefer a language other than the default.
Disabilities Affected
Potential fix
Add a lang attribute to the html element (e.g. ) whose value represents the primary language of document.
Make sure you identify a language in the opening element and spell the attribute correctly. For example, if the primary language of a document is English, you could specify the language as follows:
If you would like, you can even specify some dialects with codes such as "en-US" to signify American English or "fr-CA" for Canadian French. You can find a list of language and dialect codes on the internet.
If the language changes within a document, you can specify this as follows:
If you are using a language that is written right to left, be sure to specify this using the dir attribute:
If you would like to specify that a language is written left to right, you can fill the value of the dir attribute with the value "ltr".
Success criterion
3.1.1 Language of Page: The default human language of each Web page can be programmatically determined. (Level A)
Why it matters
When configuring a screen reader, users select a default language. If the language of a webpage is not specified, the screen reader assumes the default language set by the user. Language settings become an issue for users who speak multiple languages and access website in more than one language. It is essential to specify a language and ensure that it is valid so website text is pronounced correctly.
Screen readers use different sound libraries for each language, based on the pronunciation and characteristics of that language. Screen readers can switch between these language libraries easily, but only if the documents specify which language(s) to read and when. If the language is not specified, the screen reader reads the document in the user's default language, resulting in a strange accent! It is impossible to understand anything when screen readers are using the wrong language library.
WCAG Guidance
Deque University - https://dequeuniversity.com/rules/axe/3.5/html-has-lang?application=AxeChrome
W3C Understanding WCAG 2.0 - SC 3.1.1 Language of Page
The text was updated successfully, but these errors were encountered: