Goal
Ensure that inline language changes are set accurately, so that screen readers read the contnent in the right language.
Why this matters
If the language is set incorrectly or not at all, a screen reader will read the content in the user’s default language. That can result in the wrong accent being applied to words, making it so the content isn’t understandable.
How to implement
Writer
Ensure the team is aware if any part of the page’s language should be set to something else.
Developer
For instructions on using the lang attribute, see MDN’s page:
How to test
Manual testing
Right-click the content on the page that should be set to a different language and ensure that the content element (usually a <p>
) contains the lang
attribute specified by your Writer.
Automated testing
HTML validators should report back an error if the lang
attribute is set to an invalid value. Note that automation cannot determine if a lang
attribute should be set based on the content.