Skip to main content
WCAGrules
Quick navigation

Language of Parts

When a passage switches language, that passage needs its own lang attribute, so the screen reader switches pronunciation for it and switches back afterwards. A single word counts. Four kinds of content are excepted, and between them they cover most of what looks like a failure at first glance. Proper names are out, so Albert Camus in an English article needs nothing. Technical terms are out, which covers habeas corpus and Homo sapiens. Words of indeterminate language are out. And so are borrowed words that have settled into the surrounding language, which is why rendezvous in an English sentence is just an English word now.

Why it matters

A quote read with the wrong phonetics is mangled for the blind reader, and it is mangled worst for the bilingual reader who would otherwise have understood it perfectly. The French word voiture, read by an English voice, comes out as voyture. Nobody hears a car. The same thing happens to a language switcher, where Français read with English phonemes is unrecognizable to the French speaker hunting for it. One honest limit comes with this. Accessible names are flat strings, so when a screen reader user pulls up the list of links on a page, the language marking inside those names is stripped and no voice switch happens. W3C treats that as a limit of the software rather than a failure of your page, and says outright that it does not fail this criterion. The markup is still required, and how far it carries depends on which browser and which screen reader the reader happens to be using.

Who this rule protects

Multilingual screen reader users are who this rule is for, because they cannot recognize their own language when the page mispronounces it. Anyone using a language switcher needs their language's name spoken well enough to pick it out of a list. Braille readers need it too, since language decides which contractions the software may use. And people relying on captions use it to spot a language change in a soundtrack.

How to check it yourself

  1. Find every passage that is genuinely in another language, then set the four exceptions aside. Proper names, technical terms, words of indeterminate language, and borrowed words that have become ordinary in the surrounding text are all outside this rule.
  2. Where you are unsure, say the word aloud in the surrounding language. If it would be pronounced the same way there, treat it as part of that language and leave it alone.
  3. Check each remaining passage sits inside an element carrying the right lang value, such as lang="fr" on a blockquote holding a French quote.
  4. On links and other controls, consider moving the attribute onto the control itself rather than a span inside it. Either placement conforms, and the outer one survives more screen reader modes, so treat it as a support improvement to suggest rather than a failure to raise. W3C is explicit that it does not work in every browser and screen reader pairing either.
  5. On a single-language site, check for wrong markup rather than missing markup. Every unmarked passage inherits the language on the html element, so nothing is left to add, but a stray lang="en" left on a German quote by a template is still a failure.

Failures we see most often

  • International testimonials are all read out with English pronunciation, whatever language they were written in.
  • A language switcher lists Deutsch and Français with no lang attribute on any option, so the one word each user needs to recognize is the one word that gets mangled.
  • Somebody strips the lang attributes off quoted passages because the screen reader ignored them anyway, which removes the one thing the rule actually asks for. Silence in a particular reader is not evidence the markup was wrong.
  • A passage carries lang="de" over French text. The tag is valid, so the approved automated rule passes it, and the rule that would compare the tag against the words is still only proposed.
  • A remediation pass marks up every address and product name as a foreign passage, which adds work and noise without adding accuracy, because proper names are excepted.

Who this one is for

Read from this rule's own note above, so the grouping and the note cannot disagree.

How this one is tested

We list 2 ACT rules against 3.1.2. Each one defines exactly what a checker looks at, which is how automated tools decide what to flag. Each one also checks a slice, so passing every rule here is not the same as meeting the criterion, and a rule can be proposed rather than approved or need a person to finish it. The note beside each says which.

How to fix it

  • Wrap each genuinely foreign passage in an element carrying the right code, and put the attribute on the outermost element that holds only that passage.
  • In a language menu, mark each option with its own code on the link itself. Deutsch takes lang="de" and Français takes lang="fr", so each one is announced by the voice that makes it recognizable.
  • Use the primary code and stop there unless a region genuinely matters. For French, fr is enough. Add fr-CA only where the difference between Canadian and European French changes something for your reader.
  • Mark the passage when it uses a different script or a transliteration, because that is where pronunciation goes furthest wrong. A pinyin phrase inside English text takes zh-Latn-pinyin.
  • Leave brand names, Latin terms and settled loanwords alone. Marking them is allowed as a courtesy where pronunciation suffers, and it is never required.
Step-by-step fix guides (2)

Passes vs. fails

A general illustration of the pattern rather than a test of 3.1.2. Passes: the right voice reads the page. Fails: no lang, so the wrong voice reads it.

Passes

The same quote sits inside <blockquote lang="de">, so the screen reader switches to its German voice for that passage and back to English straight after.

Fails

A German testimonial carries no lang attribute, so it is read with English phonetics and the German speakers it was written for cannot follow it.

In audits and lawsuits

This is where international brands lose people, so we check quoted passages, testimonials and above all the language selector, because a failure there locks a user out of their own locale. Two things keep our findings honest. The exceptions are real, so we do not raise anything against a brand name, a Latin term or a loanword that has become ordinary in the sentence around it. And we read the markup rather than trust the speech, because W3C says outright that a correctly marked page can still sound wrong in a screen reader's list-of-links view, that this does not fail the criterion, and that auditors therefore have to check the code instead. A scanner here checks that a tag is valid, not that it is right. The rule that compares the declared language against the actual words is still only proposed.

Go somewhere useful

Find tools, resources and your workspace.

29 destinations