lang attribute must have a valid value

Log in (Premium content) Request a demo

Rule Description

The language specified in the HTML document must be one of the valid languages to ensure text is pronounced correctly for screen reader users.

The Algorithm, in Simple Terms

lang attribute must have a valid value

Why this is Important

When configuring a screen reader, users select a default language. If the language of a webpage is not specified, the screen reader will assume it is the default language set by the user. This becomes an issue for users who speak multiple languages and access website in more than one language. It is important to specify a language and ensure that it is valid so website text is pronounced correctly.

How to Fix the Problem

Ensure that the language code specified in the lang attribute is a valid language code (e.g. <html lang="en"> would set the language of the document to English).

Compliance Data & User Impact

User Impact: Serious
Disabilities Affected:
  • Blindness
  • Deafblindness
  • Cognitive
Issue Type:
  • WCAG 2.0 (AA): MUST
  • WCAG 2.1 (AA): MUST
WCAG Success Criteria:
  • 3.1.2 Language of Parts
Section 508 Guidelines:
  • Not applicable

Related Deque University Course Pages

Other Related Resources

Additional Information

Relevant Technologies:
  • HTML 4
  • HTML5
Test Reliability: Automated testing is possible, with high accuracy
Rule ID: valid-lang