Language
Setting the language of your site allows assistive technology to interact with your content correctly. Assistive technology will read foreign languages, but it needs to know the main language of the page and when the content’s language differs from the page’s default.
Testing
- Open the inspector panel.
- Locate the main
html
tag.- If the
lang
attribute isn’t set to the correct language, this is a failure.
- If the
- Identify any content that differs from the default language, make sure the content has its own
lang
attribute set with that language.- Any alternate language content not set constitutes a failure.
Examples
Fails
Sus ojos son verdes.
This text is Spanish and lacks a lang
attribute.
Passes
Sus ojos son verdes.
This text passes because the lang="es"
attribute identifies its content as Spanish.