Skip to content
Learn Measure Blog Case studies About
On this page
  • How the Lighthouse invalid lang attribute audit fails
  • How to fix invalid lang attribute values
  • Resources

[lang] attributes do not have a valid value

May 2, 2019 — Updated Sep 19, 2019
Appears in: Accessibility audits
On this page
  • How the Lighthouse invalid lang attribute audit fails
  • How to fix invalid lang attribute values
  • Resources

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:

Lighthouse audit showing elements with an invalid value for the lang attribute
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.

Resources #

  • Source code for [lang] attributes do not have a valid value audit
  • lang attribute must have a valid value (Deque University)
Last updated: Sep 19, 2019 — Improve article
Return to all articles
Share
subscribe

Contribute

  • File a bug
  • View source

Related content

  • developer.chrome.com
  • Chrome updates
  • Web Fundamentals
  • Case studies
  • Podcasts
  • Shows

Connect

  • Twitter
  • YouTube
  • Google Developers
  • Chrome
  • Firebase
  • Google Cloud Platform
  • All products
  • Terms & Privacy
  • Community Guidelines

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies.