An incorrect lang attribute can negatively impact screen reader software, which relies on the lang attribute to apply the correct pronunciation and reading rules. Other tools that rely on proper language designation include translation software and spellcheck and grammar tools.
This check affects users who have:
lang attribute to apply the correct pronunciation and reading rules. lang attribute to apply the correct language pronunciation, and spellcheck and grammar tools, which rely on the lang attribute to apply appropriate spellcheck and grammar rules.This section provides some pass and fail examples.
The correct language for the entire page is specified
<html lang="en">
<head>
<title>Welcome</title>
</head>
<body>
<p>Hello, how are you?</p>
</body>
</html>lang="en" attribute matches the language of the page.A section in a different language is correctly specified
<p lang="fr">Bonjour, comment ça va ?</p>lang="fr" attribute matches the French text.The wrong language is declared for the content
<p lang="de">Hola, ¿cómo estás?</p>lang="de", which is German.Fix:
<p lang="es">Hola, ¿cómo estás?</p>lang="es" is applied.A missing language attribute for multilingual content
<p>Welcome! <span>Bienvenido!</span></p>lang attribute to indicate the Spanish text is missing.Fix:
<p>Welcome! <span lang="es">Bienvenido!</span></p>This section provides instructions on how to review and fix this issue.
lang attribute is applied to sections where the language changes. lang value matches the actual language of the text.Ensure that the primary language of the page is correctly declared in the <html> tag.
<html lang="en">Use lang attributes for content in different languages
<span lang="fr">Bonjour</span>Test the page with a screen reader to verify the pronunciation.
For information about language tags and how to find out the correct tag, visit the following article:
If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.