WCAG (Level A) SC 3.1.1 Language of Page (w3.org)
Issue description
WCAG 3.1.1, “Language of Page” is a fundamental accessibility guideline that requires web pages to declare their default human language. This is important because assistive technologies, like screen readers, and other user agents, like browsers and translation tools, rely on this information to process and present content correctly.
Many websites fail to declare the language of the page or declare it incorrectly. This can create problems for:
- Screen reader users: Screen readers may mispronounce words or use incorrect intonation if they don’t know the language of the page. This can make it difficult for users to understand the content.
- Users with cognitive disabilities: Users with cognitive disabilities might find it difficult to understand content if it’s not presented in their expected language, which can impact comprehension and reading flow.
- Translation tools: Translation tools may not be able to accurately translate the content if the language is not declared or is declared incorrectly.
- Search engines: Search engines use language information to index and rank web pages. Incorrect or missing language declarations can affect a website’s visibility in search results.
Essentially, this guideline ensures that web pages are properly identified with their default language, improving accessibility and usability for everyone, especially those who rely on assistive technologies or speak different languages.
Related requirements
The following WCAG source criteria are often related to this as well. They can provide additional insights into specific challenges you may be encountering.
- WCAG (Level AA) SC 3.1.2 Language of Parts
- WCAG (Level AAA) SC 3.1.3 Unusual Words
- WCAG (Level AAA) SC 3.1.4 Abbreviations
- WCAG (Level AAA) SC 3.1.5 Reading Level
- WCAG (Level AAA) SC 3.1.6 Pronunciation
Who this issue impacts
Follow the links for additional information on user impairments:
Suggestions for remediation
Remediating WCAG 3.1.1, “Language of Page” is a straightforward process that involves declaring the default human language of the web page in your HTML code. Here’s how:
- Identify the primary language: Determine the main language used on the web page. This is usually the language in which most of the text content is written.
- Use the lang attribute: Add the lang attribute to the tag in your HTML code.
- Specify the language code: Use the appropriate language code according to the ISO 639-1 standard. This is a two-letter code that represents the language. For example:
en
for Englishes
for Spanishfr
for Frenchde
for Germanja
for Japanese
Example
If your web page is primarily in English, your HTML code should look like this:
HTML
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
</body>
</html>
Important considerations
- Consistency: Ensure that the language declared in the lang attribute matches the actual language used on the page.
- Changes in language: If there are sections of the page in a different language, use the lang attribute on those specific elements (e.g.,
<p lang="fr">
) to indicate the change. - Validation: Use an HTML validator to check that the
lang
attribute is used correctly.
By declaring the language of the page, you help browsers and assistive technologies understand how to process and present the content correctly, improving accessibility and usability for everyone.