Qualebook

Qualebook

The source code of each part indicates the main language of the content

Not all text-to-speech tools or electronic braille displays automatically adapt to the book’s main language. Therefore, this information must be provided in the source code for each Content Document.

Objectives

  • Allow correct reading of content by a voice synth tool.
  • Facilitate machine translation.
  • Promote content indexing by language.

Implementation

  • The lang attribute must be added to the Content Document html root to indicate the main language of the text.
  • The language code must conform to the registry of language subtags managed by IANA (Internet Assigned Numbers Authority). In practice, for Frenchman, it gives : html lang="en" (in HTML) and html lang="en" xml:lang="en" (in XHTML). If the language varies from the integer of a book (e.g. an English text in a chapter written in French), you can also use the lang attribute (and xml:lang for XHTML) on specific document elements to indicate a language change within a section.
  • This can be done on tags like p, div, or even span, to indicate a passage in a different language: <p lang="en">This text is in English.</p> <p lang="fr">This text is in French.</p> If the main language of the document changes in different parts of the content, you can set the lang attribute (or xml:lang for XHTML) at the level of several parent elements, such as head, body, title, etc., to indicate the dominant language in the sections in question.

Control

  • Check that the Content Document’s html root element has the lang, e.g. html lang="en" (in HTML) and html lang="en" xml:lang="en" (in XHTML), to indicate the primary language of the document.
  • Check that the xml:lang attribute is also available in XHTML documents to ensure compatibility with older systems and tools that require this additional specification.
  • Make sure all multilingual content uses the lang attribute on the relevant elements, such as p, div, or span, to indicate language changes to the document integer.
  • Check that languages of metadata and content in sections like head, title, and body are well specified with the lang attribute to ensure consistency of language information.
  • Make sure the language code used in the lang attribute meets the standards established by the IANA registry of language subtags, and matches the language of the content. Please note that mul codes for “multiple languages” and “indeterminate language” should not be used. Finally, the xml:lang attribute can also be fully informed of the lang, but it is not enough to conform to this good practice.

Validation

  • Reported by epubcheck.
  • Needs to be verified by a human.