Skip to content
easeweb
Search topics

Passages in another language read with the wrong voice

A product page shows a customer review in French and a language switcher, but neither carries its own lang, so a screen reader reads both with English pronunciation.

WCAG 2.2
SC 3.1.2AA
Required by
Section 508 · EN 301 549 (EU)
Broken <p class="review-text">Parfaite pour le café…</p>
The accessibility problem illustrated: No vision:What did that review say?
01

The problem

Screen reader and braille users get passages in another language read with the page's pronunciation rules, which can make them impossible to follow.

02

Try it

Listen to the French review and the language links.

Press Listen on each review and on the language links to hear them with the voice their lang picks, if your device has one; the panel shows the voice, roughly how it sounds, and where its language comes from.

Broken Can you fix this?

BrokenA French review and a language switcher with no lang

Enamel camping mug

  • Light, tough, and keeps tea hot. Sam, Leeds
  • Parfaite pour le café du matin au camping. Camille, Lyon

Press Listen on a review or on the language links.

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Mark every passage in another language with its own lang, on the element that holds it, from the language it was written in.

  1. 1Every passage in another language carries its own valid lang, on the element that wraps it.
  2. 2Each name in a language switcher carries the lang of that language.
  3. 3Content that comes from data takes its lang from the language stored with it; hreflang never stands in for lang.
Before A French review and a language switcher with no lang
<html lang="en">…<h1>Enamel camping mug</h1>…<ul class="reviews">  <!-- rendered from the reviews feed -->  <li>    <p class="review-text">Light, tough, and keeps tea hot.</p>    <p class="reviewer">Sam, Leeds</p>  </li>  <li>    <p class="review-text">Parfaite pour le café du matin au camping.</p>    <p class="reviewer">Camille, Lyon</p>  </li></ul>…<footer>  <nav aria-label="Language">    <a href="/en/" aria-current="true">English</a>    <a href="/fr/" hreflang="fr">Français</a>    <a href="/de/" hreflang="de">Deutsch</a>    <a href="/es/" hreflang="es">Español</a>  </nav></footer>
After Lang on each passage
<html lang="en">…<h1>Enamel camping mug</h1>…<ul class="reviews">  <!-- each li takes the language stored with its review -->  <li lang="en">    <p class="review-text">Light, tough, and keeps tea hot.</p>    <p class="reviewer">Sam, Leeds</p>  </li>  <li lang="fr">    <p class="review-text">Parfaite pour le café du matin au camping.</p>    <p class="reviewer">Camille, Lyon</p>  </li></ul>…<footer>  <nav aria-label="Language">    <a href="/en/" aria-current="true">English</a>    <a href="/fr/" hreflang="fr" lang="fr">Français</a>    <a href="/de/" hreflang="de" lang="de">Deutsch</a>    <a href="/es/" hreflang="es" lang="es">Español</a>  </nav></footer>

Fixing this with an AI coding assistant? Get this guide as Markdown, or get every guide in your coding agent.

04

Verify the fix

5 checks, no mouse.

Test with: Screen reader

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat when content from a new source, or a new language, is added.

Limits

This is a starting pattern, not a guarantee for every application. Screen readers switch voices only when a voice for that language is installed, and some let the user turn automatic language switching off; that is outside your control, but the markup must still be right. Some screen readers also try to guess the language from the text itself; a guess is least reliable for a short passage in the same letters as the page, and not every reader makes one, so it doesn't replace lang. Whether a word needs marking can be a judgement call: check the passages that matter with someone who reads that language if you can.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work