About this Test
This test checks that lang attributes within the body of a web page are correct
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
Understanding Success Criterion 3.1.2: Language of Parts
How to Repair
The language of an element can be specified by its lang attributes.
The value of the lang
is composed from a sequence of one or more "subtags" divided by "-", each of which refines or narrows the range of language. It has to conform to BCP 47
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
- Principle 3:
Information and the operation of user interface must be understandable.
WCAG 2.0: Principle 3
Make text content readable and understandable.
Understanding Guideline 3.1
Success Criterion 3.1.2:
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. (Level AA)
Understanding: Success Criterion 3.1.2