Start here
Before You Fix It: What This Check Means
The HTML lang attribute helps assistive tech and search systems choose correct language handling. In plain terms, this checks whether the page declares its main language for browsers, search engines, and assistive tools. Scavo reads `lang` (or `xml:lang` fallback) from the `<html>` element and validates format.
Why this matters in practice: operational drift here often causes hard-to-debug regressions across environments.
How to use this result: treat this as directional evidence, not final truth. This result reflects what was observable at scan time and should be verified in your own production context. First, confirm the issue in live output: verify directly in live production output with browser/network tools Then ship one controlled change: Set `lang` in shared base layout. Finally, re-scan the same URL to confirm the result improves.
Background sources
TL;DR: The HTML lang attribute is missing, so screen readers use the wrong pronunciation rules and translation tools can't detect your language.
Screen readers use the lang attribute to select the correct pronunciation engine — without it, they apply default language rules that mispronounce words and ignore language-specific grammar. Browser translation tools also rely on lang to detect when to offer translation. It's a single attribute on the html element that takes 5 seconds to add.
What Scavo checks (plain English)
Scavo reads lang (or xml:lang fallback) from the <html> element and validates format.
Current logic:
Warning: no language attribute foundWarning: language value exists but format is invalidPass: valid language tag format detected
Accepted format is based on BCP 47 style patterns (for example en, en-gb, fr, es-419).
How Scavo scores this check
Scavo assigns one result state for this check on the tested page:
- Pass: baseline signals for this check were found.
- Warning: partial coverage or risk signals were found and should be reviewed.
- Fail: required signals were missing or risky behavior was confirmed.
- Info: Scavo could not gather enough reliable evidence on this run to score pass/fail confidently.
In your scan report, this appears under What failed / What needs attention / What is working for language_attribute, followed by Recommended next steps and Technical evidence (for developers) when needed.
- Scan key:
language_attribute - Category:
TECHNICAL
Why fixing this matters
Language metadata helps assistive technologies, translation systems, and browser processing behavior.
Missing or malformed language tags can reduce accessibility quality and international correctness.
If you are not technical
- Ask your developer to confirm
<html lang="...">exists on live pages. - Check localized versions use matching language tags.
- Ensure the value reflects real page language.
- Re-run Scavo and confirm pass.
Technical handoff message
Copy and share this with your developer.
Scavo flagged Language attribute (language_attribute). Please add/fix the root <html lang="..."> declaration using a valid BCP 47 language tag and verify localized routes use correct values.If you are technical
- Set
langin shared base layout. - Use locale-aware rendering for translated routes.
- Validate generated language tags from locale config.
- Keep
langsynchronized with actual content language.
How to verify
- View source and confirm
<html lang="...">on key templates. - Validate tags for locales (for example
en-gb,fr-fr,es-419). - Confirm no malformed custom codes are emitted.
- Re-run Scavo and confirm pass.
What this scan cannot confirm
- It does not validate translation quality.
- It does not verify full international SEO implementation.
- It checks format/presence, not semantic correctness of every phrase.
Owner checklist
- [ ] Assign owner for locale metadata in base templates.
- [ ] Keep locale-code mapping centralized.
- [ ] Add release checks for missing/invalid
langvalues. - [ ] Re-test after localization routing changes.
FAQ
Is xml:lang enough?
This check uses it as fallback, but standard lang on <html> should be present.
Can one site have different lang values by route?
Yes, and that is expected for multilingual sites.
Why does format matter?
Malformed tags can be ignored by tools that rely on standardized language codes.
What is the safest default for English-only pages?
Use an explicit value like en (or a region-specific variant if appropriate).
Sources
Need help mapping URL locales to valid language tags? Send support your locale config.