Languages within the body [SC3-1-2-lang]
Test infoPossible Results
Test info
Test for Success Criterion 3.1.2
About
Checked Elements: descendent-or-self::body[@lang]
This test checks that lang attributes within the body of a web page are correct
Short Description
This test is applied to all elements with lang attribute in the body of the web page (including the body element itself).
If the value of lang attribute is on the list of languages (BCP 47: http://www.rfc-editor.org/rfc/bcp/bcp47.txt) the test would pass. Otherwise, test would fail. Description: https://www.w3.org/community/auto-wcag/wiki/SC3-1-2-lang
How to Repair
The language of an element can be specified by its lang attributes.
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
- Value of lang attribute for the element is incorrect
-
Unknown language code.
- Correct lang attributes
-
The lang attributes of elements within the body of the page are correct.