The issue

WCAG success criterion 3.1.2 requires that each language change in a page's content be indicated in the source code via the lang attribute on the HTML element containing the foreign-language text. Without this indication, screen readers use the pronunciation rules of the page's main language (defined on the html tag) to read the foreign text, producing incorrect and often incomprehensible pronunciation. When a screen reader configured in English encounters a French phrase without a language change indication, it pronounces it with English phonetic rules, distorting every sound. For isolated, common words, the user may guess the meaning. But for entire sentences in French, German, Spanish, or any other language, the result is totally incomprehensible. Imagine a quote in French read with an exaggerated English accent, every sound distorted by inappropriate pronunciation rules: this is what screen reader users experience when language changes are not marked. This problem is widespread because many websites mix languages without attention. Technical English terms in a French article (cloud computing, machine learning, responsive design), foreign-language citations, product or brand names, foreign addresses and place names, bilingual content blocks: all these cases require language markup. The fix is simple: wrap foreign-language text in a span (or any other appropriate element) with the lang attribute corresponding to the ISO 639-1 language code. For example, <span lang="fr">bonjour</span> tells the screen reader to switch to French pronunciation for that word.

Does your site have this issue?

106 RGAA criteria analyzed in 5 minutes by our AI.

Test your site for free

Impact on users

For a screen reader user, foreign-language text read with incorrect pronunciation is at best annoying, at worst incomprehensible. Modern speech synthesizers are very faithful to each language's phonetics, which means they rigorously apply English rules to French text: the result is an audio mess. Blind people who do not know the foreign language in question are even more impacted because they cannot compensate by guessing words through language knowledge. Braille display users are also affected: the braille table used depends on the declared language. English text displayed with a French braille table may produce incorrect characters. In summary, language markup is a small technical effort with a significant impact on experience quality for assistive technology users.

Code example

Before (non-compliant)
<html lang="en">
<body>
  <p>Subscribe to our newsletter for updates.</p>
  <blockquote>
    "Le pouvoir du Web est dans son universalite."
    — Tim Berners-Lee
  </blockquote>
  <p>Our solution uses machine learning
    and Kubernetes for data analysis.</p>
  <footer>
    <p>Fait avec amour a Paris</p>
  </footer>
</body>
</html>
After (compliant)
<html lang="en">
<body>
  <p>Subscribe to our newsletter for updates.</p>
  <blockquote lang="fr">
    "Le pouvoir du Web est dans son universalite."
    — Tim Berners-Lee
  </blockquote>
  <p>Our solution uses machine learning
    and Kubernetes for data analysis.</p>
  <footer>
    <p><span lang="fr">Fait avec amour</span> in Paris</p>
  </footer>
</body>
</html>

Frequently Asked Questions

Must I mark every common foreign word (email, web, blog)?
No. Loan words that have passed into common English usage and appear in English dictionaries (email, web, blog, marketing, design) do not need to be marked. They are pronounced comprehensibly by English speech synthesizers. Mark words and expressions that are not in common English usage or that form complete sentences in a foreign language.
How do I indicate the language of a link whose text is in a foreign language?
Add the lang attribute on the link or on an internal span: <a href="/terms" lang="fr">Conditions Generales</a>. If only part of the link is in a foreign language, wrap that part in a span: <a href="/terms">Terms — <span lang="fr">Conditions Generales</span></a>. The hreflang attribute indicates the target page's language, not the link text's language.
What language codes should I use?
Use ISO 639-1 two-letter codes: en for English, fr for French, de for German, es for Spanish, it for Italian, pt for Portuguese, ar for Arabic, zh for Chinese, ja for Japanese. For regional variants, add the country code: en-US, en-GB, pt-BR, zh-CN.
Is the lang attribute important for SEO?
The lang attribute on the html tag helps search engines understand the page's main language. Internal language changes (span lang="fr") are less critical for SEO but contribute to the overall quality of semantic markup, which search engines value. This is primarily an accessibility concern, not a SEO one.

Does your site have this issue?

Scrutia audits your site against WCAG 2.1 AA criteria in 5 minutes. Keyboard navigation, ARIA components, visible focus, contrasts, and much more.

Run a free audit