Primary language of page [SC3-1-1-html]

Test info
Possible Results

Test info

Test for Success Criterion 3.1.1


Checked Elements: html element
This test checks that the primary language of the web content can be programmatically determined.

Short Description

It is necessary to mark the primary language of a web page. This makes it possible for user agents and assistive technologies to present content correctly.<br> Screen readers can use the pronunciation rules of the language of the text. Visual browsers can display characters and scripts in appropriate ways. Furthermore automatic processing of the content like automatic translation or providing additional information using a dictionary are made possible. <br> If the html element has a lang attribute and the value of lang attribute is on the list of languages of <a href="">BCP 47</a> the test would pass. Otherwise, test would fail. <br> Autowcag test description: <a href="">SC3-1-1-html</a>

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 both attributes, their values have to be the same.

The value of the language attribute 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

Possible Results

Failed Unknown language code.

Unknown language code.

Failed No language attribute found.

No language attribute found.

Passed Primary language detected correctly

The primary language of the web content can be programmatically determined