Language of Parts
The human language of each passage or phrase in the content can be programmatically determined, except for proper names, technical terms, words of indeterminate language, and words or phrases that have become part of the vernacular of the immediately surrounding text.
What it means
The intent of this success criterion is to ensure that user agents can correctly present phrases, passages, and in some cases words written in multiple languages. This makes it possible for user agents and assistive technologies to present content according to the presentation and pronunciation rules for that language. This applies to graphical browsers as well as screen readers, braille displays, and other voice browsers. Both assistive technologies and conventional user agents can render text more accurately if the language of each passage of text is identified. Screen readers can use the pronunciation rules of the language of the text. Visual browsers can display characters and scripts in appropriate ways. This is especially important when switching between languages that read from left to right and languages that read from right to left, or when text is rendered in a language that uses a different alphabet. Users with disabilities who know all the languages used in the web page will be better able to understand the content when each passage is rendered appropriately. When no other language has been specified for a phrase or passage of text, its human language is the default human language of the web page (see Success Criterion 3.1.1 Language of Page ). So the human language of all content in single language documents can be programmatically determined. In certain situations or modes of operation, screen readers and other assistive technologies will announce an element using its computed accessible name . As an example, this currently happens in most commonly available screen readers when accessing the isolated list of links in the current page.
Failing example
<!-- Fails: French quote on English page, no lang attribute -->
<p>As the saying goes: <q>Vouloir, c'est pouvoir.</q></p>How to fix it
<!-- Pass: lang attribute on the foreign-language passage -->
<p>As the saying goes:
<q lang="fr">Vouloir, c'est pouvoir.</q>
</p>How A11yRisk detects this
A11yRisk detects this criterion automatically.
Scan your site for this violation →