Language of Parts [SC3-1-2-xml-lang]
Test infoPossible Results
Test info
Test for Success Criterion 3.1.2
About
Checked Elements: descendent-or-self::body[@xml:lang]
This test checks the value of the xml:lang attributes.
Short Description
If an element has xml:lang attribute, it should also contains a lang attribute with the same value.
How to Repair
The language of an element can be specified by its lang and xml:lang(optional) attributes.
If you use
Examples of valid language tags are
- nb – for Norwegian Bokmal
- nn – for Norwegian Nynorsk
- en – for English
- en-US – for English as used in the USA
WCAG 2.0
- Principle 3: Understandable
-
Information and the operation of user interface must be understandable.
WCAG 2.0: Principle 3 - Guideline 3.1: Readable
- Make text content readable and understandable. Understanding Guideline 3.1
- Success Criterion 3.1.2: Language of Parts (Level AA)
- 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. (Level AA) Understanding: Success Criterion 3.1.2
- Technique
Possible Results
- Contradicting language attributes.
-
The attributes lang and xml:lang are contradicting
- No lang is specified
-
The xml:lang is specified for the element but no lang attribute found
- Element with equal lang and xml:lang
-
The element contains a lang attribute with the same value to xml:lang.