PDF19: Specifying the language for a passage or phrase with the Lang entry
in PDF documents

Important Information about Techniques

See Understanding Techniques for WCAG Success Criteria for important information about the usage of these informative techniques and how they relate to the normative WCAG 2.0 success criteria. The Applicability section explains the scope of the technique, and the presence of techniques for a specific technology does not imply that the technology can be used in all situations to create content that meets WCAG 2.0.

User Agent and Assistive Technology Support Notes

Description

The objective of this technique is to specify the language of a passage,
phrase, or word using the /Lang entry to provide information in the
PDF document that user agents need to present text and other linguistic
content correctly. This is normally accomplished using a tool for authoring
PDF.

Both assistive technologies and conventional user agents can render
text more accurately when the language is identified. Screen readers
can load the correct pronunciation rules. As a result, users with disabilities are better able to understand
the content.

Note: This technique can be used to set the default
language for the entire document if the entire document is contained
in the container or tag. In this case, this technique would apply to
Success Criterion 3.1.1.

Examples

Example 1: Adding a /Lang entry to specify the language for a paragraph
using Adobe Acrobat 9 Pro

Select the word or phrase that is in a different language and
create a tag for it in the Reading Order Panel (e.g., Text).

Open the Tags tab in the Show Order Panel and select the tagged
word or phrase that is in the different language. You can also use
the Options menu in the Tags tab: select Create Tag from Selection.

Right-click the selection and select Properties in the context
menu.

In the Tags tab in the Properties dialog, select the language
from the drop-down list.

When you tag a word or phrase, Acrobat splits the original content
into three document content tags: one for the text that precedes your
selection, one for the selection, and one for the text that follows
the selection. As needed, drag the document content tag for the selected
text into position between the other two tags, so that the text reads
in the proper order. All three tags must also be at the same level
beneath their parent tag. Drag them into place if they are not.

The following code fragment illustrates code that is typical for
using the /Lang entry in the structure element dictionary. In this
case, the /Lang entry applies to the marked-content sequence having
an MCID (marked-content identifier) value of 0 within the indicated
page's content stream.

Related Techniques

Tests

Procedure

Verify that the language of a passage, phrase, or word that differs
from the language of the surrounding text is correctly specified
by a /Lang entry on an enclosing tag or container:

Read the PDF document with a screen reader that supports the language of the phrase and the language of the surrounding text, listening to hear
that the text is read in the correct natural language.

Using a PDF editor, select the word or phrase that is in the different language and check that the language is set correctly.

Use a tool which is capable of showing the /Lang entry value
to open the PDF document and view the language settings.

Use a tool that exposes the document through the accessibility
API and verify that the language for the passage or phrase is
set correctly.

Verify that if the container or tag contains the entire document,
the language setting is the language intended as the default for
the document.

Expected Results

#1 and #2 are true.

If this is a sufficient technique for a success criterion, failing this test procedure does not necessarily mean that the success criterion has not been satisfied in some other way, only that this technique has not been successfully implemented and can not be used to claim conformance.