Text Properties
Properly identifying the language for your website content ensures Assistive Technology (AT) correctly interacts with your site. AT has great support for a wide variety of foreign languages, but will need to know when the 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
Failure
<p>Sus ojos son verdes.</p>
Fails: This text is Spanish and lacks a
lang
attribute to differentiate it from the page’s default language.
Passes
<p lang="es">Sus ojos son verdes.</p>
Passes: This text passes because the
lang="es"
attribute identifies its content as Spanish while the page’s default is English.