Accessibility Certified – Home

3.1.2 Language of Parts

Passages in a different language than the rest of the page are marked in code, so they are read out with the right pronunciation.

Level AAPrinciple 3: Understandable

What does it mean?

When a page contains a quote, a heading or a paragraph in another language, that part needs its own lang attribute. A screen reader then switches voice for that passage and switches back afterwards.

Exceptions are proper names, technical terms, words of unclear language and foreign words that have become part of everyday language, such as "café" in English. The links of a language switcher ("Deutsch", "Français") are a common case that does need marking.

Who does it help?

  • Screen reader users, who otherwise hear foreign words pronounced in a way that makes no sense
  • People using text-to-speech or reading aids
  • Translation tools, which can skip or handle the passage correctly

Common failures

  • A German customer quote on an English page without lang="de"
  • Language switcher links such as "Deutsch" or "Español" without a lang attribute
  • A long legal notice in a second language with no marking at all

How we test it

  • axe-core Automatic: axe-core finds typical violations. A violation is pre-filled as “fails”.

Test question: Are passages in another language marked with lang (e.g. English quotes on a German page)?

A person decides every criterion. No criterion ever passes automatically.

How to fix it

Problem
<p>Our motto: Qualität aus Leidenschaft.</p>
<a href="/de/">Deutsch</a>
Better
<p>Our motto: <span lang="de">Qualität aus Leidenschaft</span>.</p>
<a href="/de/" lang="de" hreflang="de">Deutsch</a>

The lang attribute on the element switches pronunciation only for that passage.

Practical tips

  • In a CMS, look for a "language" option in the text editor or add a span via the code view.

Official source

Understanding WCAG 2.2 at the W3C: 3.1.2 Language of Parts

How does your website do on this criterion?

The free check tests your home page automatically; the audit decides all 55 criteria.

Free checkAll criteria