Skip to main content

WCAG 3.1.2 — Language of Parts — inline language change not marked

minorWCAG 3.1.2 · Level AAcontent scope

Foreign language words or phrases in your content are not marked with the correct language code. Screen reader users who are blind may hear these words pronounced incorrectly, making content confusing or unintelligible.

Who Is Affected

Users who are blind or have low vision and rely on screen readers, particularly those who use multiple languages or need proper pronunciation to understand content context.

What This Means

When your web content includes words or phrases in a different language than the main page language, these sections must be marked with HTML language attributes. Screen readers use these attributes to switch pronunciation rules and voice settings appropriately.

For example, if your English page mentions "Ciudad de Los Angeles" or includes a Spanish quote, that text should be marked as Spanish so the screen reader pronounces it correctly rather than applying English pronunciation rules to Spanish words.

This requirement only applies to meaningful language changes — not proper nouns, technical terms that have entered common usage, or single foreign words that are widely understood in context.

Fix: Content Editor

For content management systems with rich text editors:

  1. Select the foreign language text in your content editor.
  2. Look for language options in your editor toolbar:
    • In WordPress Block Editor: Select text → Advanced → HTML anchor, add lang="xx" attribute
    • In WordPress Classic Editor: Switch to Text view, wrap text in <span lang="xx">foreign text</span>
    • In Joomla TinyMCE: Select text → Format → Inline → Language → Choose appropriate language
  3. Choose the correct language code:
    • Spanish: lang="es"
    • French: lang="fr"
    • German: lang="de"
    • Italian: lang="it"
    • Chinese: lang="zh"
  4. Verify the markup by viewing page source — you should see: <span lang="es">texto en español</span>

Examples that need language markup:

  • Extended quotes or passages in foreign languages
  • Foreign language headings or section titles
  • Technical terms in their original language when context matters

Examples that don't need markup:

  • Single borrowed words like "café" or "résumé"
  • Proper nouns like "Paris" or "Toyota"
  • Technical terms that are standard in English like "et al." or "via"

Fix: CMS / Theme

If your site frequently includes multilingual content, consider adding language selection tools to your content editor:

WordPress:

  1. Install a multilingual plugin like WPML or Polylang
  2. These plugins typically add language markup automatically
  3. Configure supported languages in plugin settings

Joomla:

  1. Enable the Language Filter plugin: Extensions → Plugins → System - Language Filter
  2. Install language packs: Extensions → Languages → Install from Web
  3. Use the built-in language switcher module for consistent markup

Standard Reference

WCAG 2.1 Success Criterion 3.1.2 — Language of Parts, Level AA

The human language of each passage or phrase in the content can be programmatically determined except for proper names, technical terms, words of indeterminate language, and words or phrases that have become part of the vernacular of the immediately surrounding text.

Check if your government website has this issue

OctoComply scans your website and documents for WCAG 2.1 AA violations. The free tier covers up to 10 pages.

Run a Free Scan