Fix "Page language not declared" in Angular
Why it's a problem
Without lang on <html>, the screen reader uses the wrong voice/pronunciation (French text read "in English" is unintelligible).
How to fix it — Angular
Declare the main language on the <html> tag with the correct code (fr, en, es, de…). Mark passages in another language with a local lang.
<!-- src/index.html -->
<html><!-- src/index.html -->
<html lang="fr">RGAA criterion 8.3 — Éléments obligatoires
Dans chaque page web, la langue par défaut est-elle présente ?
How to check: official tests (in French)
Test 8.3.1
Pour chaque page web, l’indication de langue par défaut vérifie-t-elle une de ces conditions ?
L’indication de la langue de la page (attribut
langet/ouxml:lang) est donnée pour l’élémenthtml;L’indication de la langue de la page (attribut
langet/ouxml:lang) est donnée sur chaque élément de texte ou sur l’un des éléments parents.
Full page for criterion 8.3 · Official text: Référentiel général d'amélioration de l'accessibilité (RGAA) 4.1, DINUM, Licence Ouverte 2.0.
See for another framework
Check your site in 30 seconds
Conformly detects this kind of issue across all your pages, continuously, and alerts you on every regression.
Free scan