Goal
- Enable technical aids to correctly interpret content expressed in another language.
- Simplify the work of machine translation tools.
- Enable web crawlers to extract strings of characters in a given language.
- Improve the accessibility of content for people with disabilities.
Implementation
Use the lang
attribute and the appropriate language code for all content with a different language from that of the current page. For example: <title lang="en">Open quality standards
</title>
If the content with a different language is not already tagged by an element of the existing HTML structure (title, link, quote etc.), a specific element is then required (div
or span
) to specify the language of this element (with the exception of the content of the title
element which cannot include internal markup.).
To find out more:
Control
In each page checked:
- Identify all the content written in a language other than the main language, including the content of the HTML attributes returned to the user (such as that of the
alt attribute
of images) - Check that the language of this content is specified via a
lang
attribute put in the appropriate element by the change of language (title, link, list item) or inherited from a parent element.