Change in language is not marked

Link to Change in language is not marked copied to clipboard

The change in language for a portion of content is not coded

Rule ID:
lang-change-not-marked
User Impact:
Serious
WCAG :
3.1.2.a

Rule

Inline language changes must be identified with a valid lang attribute.

Background

Most screen readers can read several different languages. When content is written in more than one language, a screen reader does not know to switch languages unless the markup tells it to. Content read with the wrong language pronunciation may be very difficult or impossible to understand. When the change in language of a particular portion of content is correctly identified, screen readers will know which language library to use.

How To Fix

Fix this issue by applying the lang attribute and correct lang value to a container containing the content that has a different language than the primary language of the page.

The lang attribute can be applied to block level elements (<div>, <h1>, <p>, <table>, etc.) as well as inline elements (<span>, <a>, <strong>, etc.).

example
<p>While in Spain, my friend tried to speak Spanish, but she wasn't very good. Everyone kept saying "<span lang="es">No comprendo nada de lo que dices.</span>"</p>