To ensure correct pronunciation, screen readers use a different sound library for each language they support. Screen readers can switch between these language libraries easily, but only if a web page specifies which language to read for a given piece of content.
If the language changes within your page, you must specify a valid BCP 47 language to ensure that the section in the new language is pronounced correctly.
How the Lighthouse invalid
lang attribute audit fails
Lighthouse flags elements that have a
lang attribute with an invalid value:
The Lighthouse Accessibility score is a weighted average of all the accessibility audits. See the Lighthouse accessibility scoring post for more information.
How to fix invalid
lang attribute values
Use only valid BCP 47 language codes in all
lang attribute values.
- Source code for
[lang]attributes do not have a valid value audit
- lang attribute must have a valid value (Deque University)