[lang]
attributes do not have a valid value
— Updated
Appears in: Accessibility audits
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:
How to fix invalid lang
attribute values #
Use only valid BCP 47 language codes in all lang
attribute values.
Resources #
- Source code for
[lang]
attributes do not have a valid value audit - lang attribute must have a valid value (Deque University)
Last updated: — Improve article