This check finds a document whose root <html> element does not declare a lang value, such as lang="en" or lang="tr".
Why this matters
Screen readers use the declared language to select pronunciation rules. Browsers and translation tools also use it to interpret the document. A missing value can make otherwise valid content difficult to understand.
How to fix it
- Set the root language to the primary language of the page using a valid BCP 47 language tag.
- Generate the value from the active locale for multilingual templates.
- Mark passages in another language with a local
langattribute when pronunciation should switch. - Do not derive the value from an untrusted request parameter without validating it against supported locales.
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 the rendered root element on every localized template and confirm the value matches the visible content. Check language changes inside mixed-language pages as well.
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.