Free scan

Fix "Page language to verify" in HTML

Why it's a problem

With no declared language, a screen reader falls back to its default voice: French text read with English pronunciation becomes unintelligible. It is among the cheapest failures to fix and the most disabling to endure.

How to fix it — HTML

Declare the main language on the <html> element with a valid code (fr, en, de…). Mark passages in another language with a local lang attribute so the screen reader switches voice at the right place.

Avoid
<html>
  <body>
    <p>Bonjour. Our <em>flagship</em> product…</p>
  </body>
</html>
Correct
<html lang="fr">
  <body>
    <p>Bonjour. Notre produit <em lang="en">flagship</em>…</p>
  </body>
</html>

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)

  1. 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 lang et/ou xml:lang) est donnée pour l’élément html ;

    L’indication de la langue de la page (attribut lang et/ou xml: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.

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

Other fixes — Éléments obligatoires