acc
How to fix: Language declaration (WCAG 3.1.1 A)
Why this matters
Screen readers switch pronunciation rules based on <html lang>. Without it, English text gets read with whatever the user's default language is — confusing and slower. WCAG 3.1.1 Level A: declare the primary language of the page.
Background
Screen readers use <html lang> to switch pronunciation rules. English text read by a French TTS engine is unintelligible. WCAG 3.1.1 Level A baseline.
References
WCAG 2.1 SC 3.1.1 Language of Page (A)
How to fix
Code snippet for each stack we cover. Pick the one matching your server / framework.
nginx
No server config — template change.
apache
Same.
cloudflare
Same.
wordpress
Edit theme header.php (or use the WP language settings). language_attributes() outputs the correct lang= automatically.
flask
<html lang="{{ config.LANG | default('en') }}"> in base template.
express
Pass lang to the template; render <html lang="...">.
rails
<html lang="<%= I18n.locale %>">.
Verify it's working
curl https://your-site/ | head -2 — should see <html lang="en"> (or your language code).
Want to know if your site has this issue?
Run a free 53-check audit — security, GDPR, NIS2, and technical SEO.
Audit my site →