Mark language changes inside PDF documents
When a passage inside a PDF is in a different language from the document around it, the tag covering that passage needs a Lang entry of its own, so screen readers switch voices mid-document and switch back afterwards. In Acrobat Pro that is set on the span or paragraph tag through the Tags panel. W3C publishes PDF19 as a sufficient technique, and it notes something useful. If the tag carrying the Lang entry contains the whole document, this is also how you set the document's default language, which is the same job PDF16 does from the catalog. Bilingual government notices and contracts with foreign-language clauses are the common cases.
How we find it in an audit
We read the secondary-language passages with a screen reader and listen for whether the voice switches, and a French clause pronounced by English rules fails. One thing has to be true before that test means anything. The screen reader has to have a voice installed for the language in question, or silence proves nothing about the tags. Then we inspect the tags covering those passages for their own Lang entries, and check whether any container is wide enough to be setting the document default by accident.
How affected users experience it
A bilingual notice tagged only with the default language reads its other half as noise. The Spanish translation, the half this reader may actually need, is pronounced with English phonetics into unintelligibility. The accommodation exists in print and fails out loud.
Passes vs. fails
Passes
Each Spanish section's container tag carries Lang es. Screen readers switch to a Spanish voice at the translation and back again after it.
Fails
A city housing notice repeats every section in Spanish, but the whole PDF is tagged en-US. The Spanish half is unreadable by ear.
How this gets tested
The W3C publishes test rules that define what a checker looks for here.
- HTML page has lang attributeA tool can check this
- HTML page lang attribute has valid language tagA tool can check this
- HTML page language subtag matches default languageA tool can check this
- Element with lang attribute has valid language tagA tool can check this
- HTML element language subtag matches languageA tool can check this
Other ways to satisfy this rule
4 guides on this site are filed under 3.1.1 Language of Page. W3C lists this one as sufficient for that rule on its own. Implement it correctly, in a way your readers' software actually supports, and the rule is met.
This guide is our interpretation of W3C technique PDF19: Specifying the language for a passage or phrase with the Lang entry in PDF documents. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.