• Success Criterion 3.1.2
  • Conformance level AA

No Way to Programmatically Tell Which Language a Passage Uses

3.1.2 — Language of Parts

Scenario

Setting

A bank's mobile money-transfer screen

What’s wrong

A Spanish-language help article is embedded inside the English transfer screen with no lang attribute marking the switch, so a screen reader keeps reading it with English pronunciation rules.

Example

<p>Please visita nuestra tienda.</p>

Why it matters

Screen-reader users hearing mixed-language content with the wrong voice rules.

How to test

Inspect any passage in a different language from the page: check whether its containing element has its own correct lang attribute — if not, it fails.

How to fix

The passage in another language must carry its own correct lang attribute.

<p>Please visit <span lang="es">nuestra tienda</span>.</p>

A lang attribute on the foreign-language span switches the screen reader's pronunciation for just that phrase.

Outcome

On a bank's mobile money-transfer screen, this barrier is gone for screen-reader users hearing mixed-language content with the wrong voice rules — they can finish what they came here to do.

Who is affected

Screen-reader users hearing mixed-language content with the wrong voice rules.

Learn more