Start scanning free

( Understandable / WCAG 3.1.2 )

lang attribute on an element has an invalid value

This check maps to Language of Parts. Use the guidance below to confirm the issue, understand who it affects and ship a fix.

Serious Level AA WCAG 3.1.2 — Language of Parts

What’s wrong

An element other than <html> has a lang attribute set to something that isn’t a valid BCP 47 language code, used to mark a passage in a different language than the rest of the page.

Why it matters

Same problem as an invalid page-level lang, just scoped to one passage: an invalid code means the screen reader can’t switch pronunciation rules for that section, so it reads a foreign phrase with the wrong accent or voice.

How to fix it

Use a valid language code for the passage’s actual language.

Before
<p>The menu features <span lang="frn">crème brûlée</span> for dessert.</p>
After
<p>The menu features <span lang="fr">crème brûlée</span> for dessert.</p>

Learn more