Summary

Setting the language ensures that assistive technologies correctly interpret and render the text, and that reading systems can make language enhancements available for users.

Techniques

Example

Example 1 — Declaring the package language

The xml:lang attribute is set to English on the package element to ensure the metadata in the package is correctly interpreted.

<package … xml:lang="en">
Example 2 — Overriding the default package language

The xml:lang attribute is used on meta elements within the metadata section to change the language from English to Japanese.

<package … xml:lang="en">
   <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
     …
     <dc:creator id="creator">Haruki Murakami</dc:creator>
     <meta property="alternate-script" xml:lang="ja">村上 春樹</meta>
     …
   </metadata>
   …
</package>
Example 3 — Identifying the primary languages of the publication

The dc:language attribute is used to indicate the primary languages of the content are French and English.

<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
     …
     <dc:language>fr</dc:language>
     <dc:language>en</dc:language>
     …
   </metadata>

Frequently Asked Questions

Do I need to list every language used in the publication?

No, the dc:language elements should only list the primary languages that the content is written in. If a publication contains a few phrases in a foreign language, for example, that language is not listed.

Explanation

Specifying the default language of the package document — as well as any changes within the document — helps ensure that assistive technologies can correctly render the publication's metadata (e.g., its title and authors). Without this information, communication of the information in a bookshelf could be compromised, for example.

Identifying the primary languages of the publication provides reading systems the ability to improve the user experience. With this information, the reading system could provide access to custom dictionaries, optimize pan-publication search capabilities, or preload text-to-speech language packs to speed up playback.

References