WCAG 3.1.1: Language of Page
Understanding WCAG 3.1.1 Language of Page
WCAG (Web Content Accessibility Guidelines) Success Criterion 3.1.1, titled „Language of Page”, is a foundational requirement at Level A (opens in a new tab). Its core principle dictates that the default human language of each web page must be programmatically determinable. This means that assistive technologies, such as screen readers, and other user agents, like search engines and translation tools, can automatically identify the primary language in which the page’s content is written.
This criterion is crucial for providing an inclusive web experience, ensuring that content is correctly interpreted, rendered, and presented to users, regardless of their language or assistive technology.
Why This Criterion Matters: Accessibility Impact and User Benefits
Properly identifying the language of a web page is essential for a wide range of users and has significant accessibility implications:
By meeting WCAG 3.1.1, you ensure that your web content is accessible, understandable, and usable by a much broader audience, enhancing the overall user experience.
Success Criterion 3.1.1 Language of Page: Requirements
The official wording for Success Criterion 3.1.1 is straightforward:
3.1.1 Language of Page (Level A): The default human language of each Web page can be programmatically determined.
To satisfy this criterion:
Practical Guidelines for Compliance
The most widely accepted and effective method for satisfying WCAG 3.1.1 is by using the HTML lang attribute on the <html> element.
Using the lang Attribute
The lang attribute specifies the primary language of the document. Its value must be a valid language tag as defined by BCP 47 (Tags for Identifying Languages) (opens in a new tab). This typically involves using ISO 639-1 two-letter language codes, optionally followed by ISO 3166-1 alpha-2 country codes for regional variants.
Placement of the lang Attribute
The lang attribute should always be placed on the <html> element. This is because the <html> element is the root element of the document, and an attribute placed here is inherited by all descendant elements unless explicitly overridden. This ensures that the declared language applies to the entire document by default.
Examples of Implementation
Correct Implementations
Example 1: English Language Page
The entire page content is in English, and the lang attribute reflects this.
Example 2: Spanish Language Page
The entire page content is in Spanish, correctly identified by the lang attribute.
Example 3: French (Canadian) Language Page with Regional Variant
Using a regional variant for specific language targeting (e.g., Canadian French).
Incorrect Implementations
Example 1: Missing lang Attribute
The most common failure. The language is not programmatically determined, thus failing WCAG 3.1.1.
Example 2: Invalid lang Attribute Value
Using a non-standard or incorrect language code will not be understood by assistive technologies or translation tools.
Example 3: Mismatched lang Attribute and Content
The lang attribute declares one language, but the primary content of the page is in another. This will cause screen readers to mispronounce the content significantly.
Best Practices and Common Pitfalls
Best Practices
Common Pitfalls
Conclusion
WCAG 3.1.1 „Language of Page” might seem like a small detail, but its impact on accessibility is profound. By correctly implementing the lang attribute on your <html> element with an accurate BCP 47 language tag, you significantly enhance the accessibility and usability of your web content. This simple yet critical step ensures that assistive technologies can function as intended, translation tools provide accurate results, and a diverse range of users can access and understand your information without unnecessary barriers, contributing to a more inclusive web for all.
Related posts
- WCAG 5.2.3: Complete processes
- WCAG 5.2.4: Only Accessibility-Supported Ways of Using Technologies
- WCAG 5.2.5: Non-Interference
- WCAG 5.3.1: Required elements of the conformity declaration
- WCAG 5.3.2: Optional Components of a Conformance Claim
Still looking for answers?
Ask our experts using online chat