This is a draft document supplied by the WCAG Techniques Task Force. It in no way represents a WCAG Working Group consensus or agreement and is provided for informational and discussion purposes only. The accessibility test listed below should not be construed as required for conformance with the proposed WCAG2.

HTML Test Suite for WCAG 2.0
Test 49 - Content has valid language code.

W3C Editor's Draft 2005-08-11

Chris Ridpath, ATRC, University Of Toronto
Jenae Andershonis, Microsoft Inc.


This test case was created by the ATRC at the University Of Toronto. It should not be construed as required for conformance with the proposed WCAG2.

The complete list of tests may be found at http://www.w3.org/WAI/GL/WCAG20/tests/

Comments on this test may be made to the WCAG mailing list.

Status Of This Test

As part of the conformance test process, this test has a status of 'accepted'.

WCAG2 Guideline

Guideline: 3.1 - Make text content readable and understandable.
Success Criteria: 1. The primary natural language or languages of the delivery unit can be programmatically determined . How to provide the natural language of each delivery unit so that it can be programmatically determined . (Informative)

Level 1

The WCAG2 has 3 priority levels for making Web content accessible. This test has a priority of 'Level 1'.


The WCAG Working Group has created techniques that describe how Web content may be made accessible. The following techniques are related to this test:

Prerequisite Tests

The following tests must be run before running this test. If any of the prerequisite tests fail then this test is invalid and should not be run.

Test Process


  1. Determine the type of content within the content.
  2. If the content is HTML, check the value of the html element's lang attribute.
  3. If the content is XHTML 1.0, or any version of XHTML served as "text/html", check the values of both the html element's lang attribute and xml:lang attribute.
  4. Note: both lang attributes must be set to the same value.
  5. If the content is XHTML 1.1 or higher and served as type "application/xhtml+xml", check the value of the html element's xml:lang attribute.
  6. Compare the language attribute value to valid language codes according to the ISO 639 specification.

Expected Results

  1. Content has valid language code.

Fail Instructions

  1. Set the lang attribute(s) to a valid language code.

Pass Instructions

Any accessibility check may be performed after this test.

Test Files

These test files contain examples of the accessibility problem detectable by this test. They may also contain more accessibility problems than the one described in this test. Please ignore any extraneous accessibility problems in these files.

Valid XHTML 1.0!