This document provides information about the Acquia Web Governance accessibility check:
Page is missing a language attribute.
HTML page has lang attribute.
What
Every HTML document must have a lang attribute on the <html> element to indicate the primary language of the page. This helps assistive technologies such as screen readers to determine how to pronounce and interpret the text correctly.
The lang attribute should:
Be present in the <html> element.
Contain a valid BCP 47 language code, for example en for English, fr for French, es for Spanish, and so on.
When is this applicable?
This check applies to all HTML documents.
Why
Valid lang attributes improve accessibility and usability in the following ways:
Ensure correct screen reader pronunciation Without a language declaration, screen readers may use the wrong pronunciation rules.
Support text-to-speech tools Some assistive technologies adjust pronunciation and reading patterns based on the language.
Enhance SEO and translation tools Search engines and translation services rely on the lang attribute to provide relevant results and accurate translations.
Who
Affected users
This check primarily benefits:
Screen reader users: Who rely on correct pronunciation.
Multilingual users: Who need accurate translations.
Search engine users: Who depend on correct language indexing.
Examples
This section provides pass and fail examples for this check.
Pass examples
A document with a valid lang attribute
<html lang="fr">
<head>
<title>Exemple de page</title>
</head>
<body>
<p>Bonjour le monde !</p>
</body>
</html>
The lang="fr" attribute correctly identifies the page as French.
A multilingual document with language changes
<p>This is an English paragraph.</p>
<p lang="es">Este es un párrafo en español.</p>
The lang="es" attribute correctly marks the Spanish text.
This document provides information about the Acquia Web Governance accessibility check:
Page is missing a language attribute.
HTML page has lang attribute.
What
Every HTML document must have a lang attribute on the <html> element to indicate the primary language of the page. This helps assistive technologies such as screen readers to determine how to pronounce and interpret the text correctly.
The lang attribute should:
Be present in the <html> element.
Contain a valid BCP 47 language code, for example en for English, fr for French, es for Spanish, and so on.
When is this applicable?
This check applies to all HTML documents.
Why
Valid lang attributes improve accessibility and usability in the following ways:
Ensure correct screen reader pronunciation Without a language declaration, screen readers may use the wrong pronunciation rules.
Support text-to-speech tools Some assistive technologies adjust pronunciation and reading patterns based on the language.
Enhance SEO and translation tools Search engines and translation services rely on the lang attribute to provide relevant results and accurate translations.
Who
Affected users
This check primarily benefits:
Screen reader users: Who rely on correct pronunciation.
Multilingual users: Who need accurate translations.
Search engine users: Who depend on correct language indexing.
Examples
This section provides pass and fail examples for this check.
Pass examples
A document with a valid lang attribute
<html lang="fr">
<head>
<title>Exemple de page</title>
</head>
<body>
<p>Bonjour le monde !</p>
</body>
</html>
The lang="fr" attribute correctly identifies the page as French.
A multilingual document with language changes
<p>This is an English paragraph.</p>
<p lang="es">Este es un párrafo en español.</p>
The lang="es" attribute correctly marks the Spanish text.