What the validator is telling you
Every piece of text in a PDF/UA file needs a declared language. The declaration can sit in three places: on the document as a whole, on a tag, or on a single run of marked content. A tag inherits from its parents, so one entry at the top covers a whole document written in one language.
This failure means the validator followed that chain upwards from a piece of text and reached the top without finding a language. It is reported once for each piece of text, so the count is usually very large and the cause is usually one missing entry.
We reproduced it
We took a one-page test file that passes veraPDF's PDF/UA-1 profile and removed its language declarations. The file had two: one on the document and one on the top-level Document tag. With both gone, veraPDF reported 514 failed checks across three rules. These are the three, shortened to the lines that matter:
<rule specification="ISO 14289-1:2014" clause="7.2" testNumber="34" status="failed" failedChecks="512">
<errorMessage>Natural language for text in page content cannot be determined</errorMessage>
<rule specification="ISO 14289-1:2014" clause="7.2" testNumber="22" status="failed" failedChecks="1">
<errorMessage>Natural language for text in Alt attribute cannot be determined</errorMessage>
<rule specification="ISO 14289-1:2014" clause="7.2" testNumber="33" status="failed" failedChecks="1">
<errorMessage>Natural language for document metadata cannot be determined</errorMessage>
That is 512 failures for the text on one page, one for the chart's alt text and one for the title in the metadata. Restoring the single entry on the document clears all 514.
When we removed only the document's entry and left the one on the Document tag, the page text still passed, because every tag inherits from that tag. Only the metadata rule failed. If your report shows the metadata failure alone, that is the pattern.
What a reader experiences
A screen reader chooses its voice and pronunciation rules from the declared language. With none declared, it falls back to its own default. For a reader whose screen reader is set to English, an undeclared French document is read as if the French words were English ones.
Why it happens
- The source document had no language set, and the export had nothing to carry over.
- The file was tagged after export, in a PDF editor or by an automatic step, and the document language was never filled in.
- Pages were merged from several files into a new one that did not inherit the setting.
How to confirm it
In Acrobat, open File, Properties and go to the Advanced tab. The Language field under Reading Options is the document's declaration. If it is empty, that is the cause.
How to fix it
The whole document
- In Acrobat: set Language on the Advanced tab of File, Properties, and save.
- InDesign: apply the language to the text, and choose the language in the export dialog.
- Word: set the proofing language of the text before exporting.
- LaTeX: with
hyperref, use\hypersetup{pdflang={en-GB}}.
Passages in another language
A quotation, a title or a glossary term in a second language needs its own declaration, or it is read with the wrong pronunciation. In Acrobat's Tags panel, right-click the tag that holds the passage, choose Properties, and set Language on the Tag tab. At the source, apply the language to that text and it is carried into the export.
The rest of the checkpoint
- 11-002 to 11-006 are the same failure for alt text and replacement text, bookmarks, annotations, form fields and metadata. One document-level entry clears them all, as the experiment above shows.
- 11-007, "Natural language is not appropriate". This one needs a person. A validator checks that a language is declared, not that it is the right one. In our validator experiment, an English document declared as German passed every rule.
How PDFxt handles it
Every file PDFxt exports is validated, and the language rules are part of that validation. Whether the declared language is the right one for each passage is still for a person to confirm.
Related
- WCAG 2.1, Understanding Success Criterion 3.1.1: Language of Page, and 3.1.2: Language of Parts.
- W3C techniques PDF16 and PDF19.
- veraPDF PDF/UA-1 profile, rules 7.2-21 to 7.2-25 and 7.2-29 to 7.2-34.