This check finds a lang value on the root <html> element that is empty, misspelled, or not a valid language tag.
Why this matters
An invalid tag may prevent assistive technologies from selecting the correct voice and pronunciation rules. It can also make locale-aware browser features less reliable.
How to fix it
- Use a base code such as
en,tr, ordewhen the regional distinction is not material. - Add a region only when needed, for example
en-GBorpt-BR. - Use hyphens and the standard language-region order; avoid underscores and invented labels.
- Validate CMS or route locale values before rendering them into the document.
When the finding appears across many URLs, fix the shared component or layout that produces it instead of patching generated HTML page by page. Recheck representative templates and responsive states after deployment so the correction does not create a regression elsewhere.
How to verify the fix
Inspect representative pages for every supported locale and compare each root language value with the actual page content. Use a BCP 47 lookup when an unfamiliar tag is required.
Keep before-and-after evidence for the affected URL, original output, correction, and verification method. If markup changes after load, test consent states, localization, responsive variants, and client-side navigation because the initial HTML and rendered DOM can differ.