Use identical xml:lang and lang attributes [SC3-1-1-xml-lang]

Test info
Possible Results

Test info

Test for Success Criterion 3.1.1

About

Checked Elements: html
This test checks the value of the xml:lang attribute.

Short Description

If <html> element contains an xml:lang attribute exists on a page, it should contain also a lang attribute with the same value.

How to Repair

Use the lang and xml:lang attributes on the html element to specify the main language used in the web page.
If you use xml:lang you need to add lang with the same value as well.

The value of the lang and xml: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
Further Information:

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.1: Language of Page (Level A)
The default human language of each Web page can be programmatically determined . Understanding: Success Criterion 3.1.1
Technique

Possible Results

Failed Contradicting language codes.

Contradicting language codes.

Failed No lang attribute found. Only xml:lang.

No lang attribute found. Only xml:lang.

Passed Same lang attributes available to xml:lang

The value of the xml:lang attribute is equal to lang attribute of html element