Definition for WCAG 2.0 success criterion 3.1.2
3.1.1 Language of Parts: The human language of each passage or phrase in the content can be programmatically determined except for proper names, technical terms, words of indeterminate language, and words or phrases that have become part of the vernacular of the immediately surrounding text.
This criterion is meant to ensure that user agents can correctly present content written in multiple languages and so that assistive technologies that help users understand text use appropriate language-specific knowledge and resources. This applies to graphical browsers as well as screen readers, Braille displays, and other voice browsers.
If there are no changes of language in the page, this criterion is marked as not applicable.
Testing success criterion 3.1.2
Input into spreadsheet
- Fail
- Phrases or passages of text where the human language differs from that of the surrounding text are not programmatically identified with a container that has a
lang
attribute, or the value of thelang
attribute is not appropriate (either invalid or not reflective of the text's human language). - Pass
- All phrases or passages of text where the human language differs from that of the surrounding text are programmatically identified with a container that has an appropriate
lang
attribute. - N/A
- The sample is for a native application.
How to test
- Verify if the content of the document contains any phrase or passage of text where the human language differs from that of the surrounding text.
- View the HTML source / DOM tree of the document (for instance, using your browser's developer tools). Alternatively, with Internet Explorer/Web Accessibility Toolbar (WAT) use Doc Info > Show Lang Attributes to get a visual representation of lang attributes present in the page's markup.
- For any phrase or passage of text identified in the first step, check that there is an appropriate container with lang 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 identified phrase or passage of text is read in the correct human language.
The following screenshot shows the lang
attributes displayed on a page after running the "Show Lang Attributes" function.
lang
attributes
Input into spreadsheet
- Fail
- Screen reader output is not in the correct human language for phrases and passages of text where the human language differs from that of the surrounding text, or the language is not explicitly defined in the document / application for those phrases and passages (meaning that it relies solely on heuristics).
- Pass
- Screen reader output is in the correct human language for all phrases and passages of text where the human language differs from that of the surrounding text, and the language is explicitly defined in the document / application.
How to test
- Read the document / navigate the application with a screen reader.
- Verify if the content of the document / application contains any phrase or passage of text where the human language differs from that of the surrounding text.
- Check that all of the text identified in the previous step is read in the correct human language.
- Open the document / application in the original authoring tool and check that the correct language is set for all the phrases or passages of text identified (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 heuristics to guess the human language of the content (as heuristics may not work consistently or correctly in all situations / on all platforms).