Setting the language ensures that assistive technologies correctly interpret and render the text, and that reading systems can make language enhancements available for users.
xml:langattribute on the
packageelement in the EPUB package document.
xml:langattribute on package document elements whenever the default language changes.
- Identify the primary languages of the publication in
dc:languageelements in package document's metadata section. [WCAG 3.1.1]
- Ensure language codes conform to BCP 47. [WCAG 3.1.1]
Frequently Asked Questions
- Do I need to list every language used in the publication?
dc:languageelements 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.
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.