Free scan

Fix "Page language not declared" in Svelte

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 — Svelte

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.

Avoid
<!-- src/app.html -->
<html>
Correct
<!-- src/app.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)

  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.

See for another framework

ReactVueAngularHTML

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