WCAG 3.1.2: Language of Parts
WCAG 3.1.2 Language of Parts: Identifying Language Changes for Accessibility
WCAG (Web Content Accessibility Guidelines) Success Criterion 3.1.2, titled "Language of Parts," is a crucial component of ensuring web content is accessible to all users. This criterion requires that when the language of a passage or phrase within a document differs from the default language of the surrounding content, it must be programmatically identified. This enables assistive technologies to accurately interpret and present the content to users.
Why Language of Parts Matters for Accessibility
The ability to programmatically determine the language of specific parts of a web page is fundamental for a truly inclusive user experience. Its impact spans several user groups and aspects of accessibility:
By meeting this criterion, you enhance the comprehensibility, usability, and overall quality of your web content for a diverse audience.
Success Criterion 3.1.2 Language of Parts (Level AA) Requirements
The official wording for Success Criterion 3.1.2 is:
The human language of each passage or phrase in the content can be programmatically determined except for proper names, technical terms, words whose language is ambiguous, and words or phrases that have become part of the vernacular of the immediately surrounding text.
Key Aspects and Interpretations:
Practical Guidelines for Compliance
The primary method for meeting Success Criterion 3.1.2 in HTML content is by using the lang attribute. The lang attribute can be applied to any HTML element to specify the language of its content and any nested elements within it, unless overridden by a nested lang attribute.
Using the lang Attribute:
Examples
Correct Implementations:
Our team often uses the phrase c’est la vie to express acceptance of a situation.
During the meeting, she frequently used the term Gestalt to describe the unified whole.
«El ingenioso hidalgo Don Quijote de la Mancha» es una de las obras más destacadas de la literatura española.
This Spanish quote is properly marked with lang="es".
This paragraph is primarily in English, but it contains a sentence in Japanese: 日本語の文章です。
Incorrect Implementations:
In these examples, the language change is either not marked or only indicated visually, making it inaccessible to assistive technologies.
Our team often uses the phrase c’est la vie to express acceptance of a situation.
(Problem: Only visual styling (italics) is used; no programmatic identification.)
During the meeting, she frequently used the term Gestalt to describe the unified whole.
(Problem: No programmatic identification, even if visually different.)
This paragraph is primarily in English, but it contains a sentence in Japanese: 日本語の文章です。
(Problem: A custom data-* attribute is not a standard way to programmatically determine language for WCAG; the lang attribute must be used.)
Best Practices and Common Pitfalls
Best Practices:
Common Pitfalls:
Conclusion
WCAG 3.1.2 Language of Parts is a relatively straightforward criterion to implement, but its impact on accessibility is profound. By ensuring that all language changes within your web content are programmatically identified using the lang attribute, you empower assistive technologies to accurately interpret and convey your message. This attention to detail significantly improves the experience for screen reader users, those using translation tools, and individuals with cognitive disabilities, making your content truly accessible and inclusive.
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