With the world being increasingly connected digitally, websites frequently feature content in multiple languages. WCAG 3.1.2 Language of Parts (Level AA) ensures that users, especially those using assistive technologies, can understand content when the language changes within web pages.
In this article, we’ll explore what conforming to WCAG 3.1.2 Language of Parts involves, and why it’s important. We’ll also explain how to implement this success criterion effectively so that every user receives clear and accurate information.
What is WCAG 3.1.2 Language of Parts (Level AA)?
WCAG 3.1.2 Language of Parts (Level AA) is a success criterion in the Web Content Accessibility Guidelines (WCAG) version 2.1. The criterion requires that “The human language of each passage or phrase in the content can be programmatically determined, except for proper names, technical terms, words of uncertain language, and words or phrases that have become part of the vernacular of the surrounding text.”
In other words, if a webpage or specific parts of its content are in a different language from the default, these changes must be indicated in the HTML code. This ensures that assistive technologies, such as screen readers and braille translation software, can correctly interpret information.
Because this criterion helps users understand content in different languages, it is listed under Principle 3 of WCAG, “Understandable.” It is further organized under Guideline 3.1, “Readable,” as it supports readability by ensuring users read content in the appropriate language.
Why is language identification important?
Implementing WCAG 3.1.2 offers various benefits to website owners and end-users.
Here are a few advantages of conforming to this success criterion:
- Supporting assistive technology users: Screen readers and braille translation software depend on language codes to convey correct information. Proper language identification ensures that users of these assistive technologies can understand content in different languages.
- Providing accurate information to visual users: Visual browsers rely on clear language identification to appropriately display characters and scripts in different languages. By conforming to WCAG 3.1.2, website owners deliver the right information to visual users.
- Achieving legal compliance: Meeting WCAG 2.1 Level AA criteria, including 3.1.2 Language of Parts, is a best practice for compliance with the Americans with Disabilities Act (ADA) and other digital accessibility laws.
Key requirements for language of parts
To meet WCAG 3.1.2, website owners must take the following actions:
- Indicate language changes in HTML: Use the lang attribute in HTML to specify the language of a page or specific parts of the content within a page. For example, if content is provided in Spanish, use:
<p lang=”es”>Este es un párrafo en español.</p> - Handle adopted words appropriately: Words or phrases adopted from other languages (e.g., “siesta” in English) do not require language markup if they are part of the vernacular.
- Mark up links to alternate language versions: If your website offers content in multiple languages, use the lang attribute to indicate the language of linked pages. For instance, if a link directs users to a Spanish-language version of your “About” page, indicate its language with:
<a href=”/es/about” lang=”es”>Sobre Nosotros</a>
How to implement WCAG 3.1.2 Language of Parts?
- Obtain an accessibility audit: Engage an accessibility expert to inspect your website and identify pages and / or content where the language is not correctly indicated.
- Set a default language: Specify the default language of each webpage using the lang attribute in the <html> tag. For example: <html lang=”en”>
- Mark up language changes: Use the lang attribute to indicate changes in language for specific sections or phrases on a webpage. For example: <p>This is an English sentence with a <span lang=”fr”>phrase en français</span>.</p>
- Test with assistive technologies: Use screen readers like NVDA or JAWS, and other assistive technologies, to verify that language changes are correctly interpreted.
- Document language guidelines: Create a style guide that outlines how to handle language changes on your website. Share this guide with your content and development teams to ensure consistent adoption.
Common mistakes to avoid
Web accessibility can be complex, and even experienced development teams make mistakes when first working toward WCAG conformance. As you implement WCAG 3.1.2, avoid the following common missteps:
- Failing to set a default language: Neglecting to specify the default language of a webpage can lead assistive technologies to incorrectly interpret information.
- Using incorrect language codes: Using incorrect or outdated language codes may also result in misinterpretation by assistive technologies.
- Ignoring language changes: Not marking up language changes for specific sections or phrases on a page can cause inaccurate interpretations and confuse users.
Improve web accessibility for a global audience
Conforming to WCAG 3.1.2 Language of Parts helps ensure that all visitors to your website receive clear and accurate information. By clearly indicating language changes, you can provide a more straightforward and inclusive digital experience for a global user base.
Remember, accessibility is not just about compliance—it’s about creating a web that works for everyone. By implementing 3.1.2 Language of Parts, you take a significant step toward achieving that goal.