Definition for WCAG 2.0 success criterion 3.1.1
3.1.1 Language of Page: The default human language of each Web page can be programmatically determined.
This criterion is meant to ensure that content developers provide information that user agents need to present text and other linguistic content correctly. Both assistive technologies and conventional user agents can render text more accurately when the language is identified. Screen readers can load the correct pronunciation rules. Visual browsers can display characters and scripts correctly. Media players can show captions correctly. As a result, users with disabilities are better able to understand the content.
However, note that proper names, technical terms, words of indeterminate language, and words or phrases that have become part of the vernacular of the immediately surrounding text, are not required to be programmatically determinable.
Testing success criterion 3.1.1
Input into spreadsheet
- Fail
- The
<html>
element lacks alang
attribute, or the value of thelang
attribute is not appropriate (either invalid or not reflective of the document's human language). - Pass
- The
<html>
element of the document (and of any frames or<iframe>
elements) has alang
attribute with the appropriate language code value. - N/A
- The sample is for a native application.
How to test
- Examine the
<html>
element of the document by viewing the source (for instance, using your browser's developer tools). - Ensure that the
<html>
element has alang
attribute, and that the value of this attribute is correct (refer to ISO language codes). - Read the document with a screen reader, listening to hear that the text is read in the correct human language.
Note: If the page contains frames or <iframe>
elements, each component sub-page also needs to have correctly defined language as above.
Input into spreadsheet
- Fail
- Screen reader output is not in the correct human language, or the language is not explicitly defined in the document / application (meaning that it relies solely on the user's locale / language settings and will therefore fail when this is different from the document / application content).
- Pass
- Screen reader output is in the correct human language, and the language is explicitly defined in the document / application.
How to test
- Read the document / navigate the application with a screen reader.
- Check that the text is read in the correct human language.
- Open the document / application in the original authoring tool and check that the correct language is set (refer to the authoring tool documentation for details on how the human language can be set). This ensures that the output from the previous step is not simply due to the screen reader using default system settings to determine the language, but that it is indeed explicitly specified (and will therefore work correctly even if a user has a different default locale/language set on their operating system or user agent).