← All criteria

Understandable · Level A · 3.1.2

Language of Parts

A passage genuinely written in a different language than the rest of the page needs its own lang attribute on the element wrapping just that passage — a French phrase quoted inside an English article, a testimonial kept in its original Spanish. Ordinary loanwords and proper names are explicitly exempt.

  • Blind
  • Cognitive
  • Deaf / hard of hearing
The problem, in practice — select the image to enlarge it
A short travel blurb compared with an unmarked versus a marked foreign-language passage. 'Different language not marked' shows an English paragraph with an embedded French sentence, "C'était un voyage inoubliable," with no lang attribute, so a screen reader mispronounces it using English rules. 'Different language marked' shows the same paragraph with the French sentence wrapped in <span lang="fr">, so the screen reader switches to French pronunciation rules for just that part. Real-world examples below show a French phrase inside English text, a Spanish testimonial quoted on an English page, and a mixed-language paragraph naming a German university, each with the foreign-language span carrying its own lang attribute. A separate panel clarifies that loanwords like 'café,' proper names, and brand names do not need a lang attribute.

How to recognize it

Look for quoted or embedded passages that are actually in a different language than the surrounding page — a pull quote left in its original language, a multilingual site's testimonials quoting customers in their own words. If that passage has no lang attribute of its own, a screen reader reads it using the page's default pronunciation rules, which can be genuinely unintelligible rather than just accented when the languages are phonetically different. Before flagging every foreign-looking word as a violation, know the real exceptions: proper names ('Beyoncé,' 'Alpha Centauri') never need marking regardless of origin; technical or scientific terms in common use ('habeas corpus,' 'hertz') don't need it; and words that have genuinely entered the vernacular of the surrounding language — 'rendezvous' in English text, 'podcast' in French text — don't need it either, because fluent readers already pronounce them as loanwords, not as foreign insertions.

How to fix it

Wrap the specific passage in an element carrying its own lang attribute — a <span lang="fr"> for an inline phrase, or the lang attribute directly on a block element like <blockquote> for a longer quoted passage. Don't over-apply this to every borrowed word or proper name; the exceptions exist precisely so that marking something like 'rendezvous' or a person's name as a language switch doesn't become noise that drowns out the genuine language changes a screen reader actually needs different pronunciation rules for.

Example

Avoid

<p>She ended the letter with <em>"Je ne regrette rien."</em></p>
<blockquote>"El tiempo cura todas las heridas," she wrote in the original Spanish.</blockquote>

Prefer

<p>She ended the letter with <em lang="fr">"Je ne regrette rien."</em></p>
<blockquote lang="es">"El tiempo cura todas las heridas,"</blockquote> she wrote in the original Spanish.

Resources