The source code of each portion indicates the main language of the content
Not all speech synthesis or electronic braille tools automatically adapt to the main language of the book. This information must therefore be provided in the source code for each serving.
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 the Internet Assigned Numbers Authority (IANA). 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.
Cela peut être fait sur des balises comme p, div, ou même span, pour signaler un passage en une langue différente : <p lang="en">This text is in English.</p><p lang="fr">Ce texte est en français.</p> Si la langue principale du document change dans différentes parties du contenu, vous pouvez définir l’attribut lang (ou xml:lang pour XHTML) au niveau de plusieurs éléments parentaux, comme head, body, title, etc., pour indiquer la langue dominante dans les sections en 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.