Page language checker

Checks that each page declares its language, marks passages in other languages and has a title.

What this check looks for

The audit runs this check with every other check, on the page as the browser renders it.

Missing page language
An html element without a lang attribute, so screen readers guess the pronunciation.
Invalid language codes
Values such as "english" or misspelled codes that assistive technology can't use.
Passages in other languages
Text in another language without its own lang attribute.
Missing page titles
Pages with no title or an empty one, so people can't tell tabs apart.

What a failure looks like

A bilingual clinic page has no lang attribute, so a screen reader set to Spanish reads English text with Spanish pronunciation.

HTML
<!-- Broken: no language declared -->
<html>
  <p>Hablamos español.</p>
HTML
<!-- Fixed: page language, plus the passage in another language -->
<html lang="en">
  <p lang="es">Hablamos español.</p>

How it shows in AccessGuard

Each finding names the WCAG criterion, explains the problem in plain words and shows the element that fails, so a developer can find it on the page.

A page language and title finding in AccessGuard with its severity, WCAG criterion, description and the affected HTML element

WCAG criteria

Findings from this check name one of these criteria. How much of each the audit can decide on its own:

WCAG criteria covered by the page language and title check
Criterion Level Automation
3.1.1 Language of Page A Automated
3.1.2 Language of Parts AA Partly automated
2.4.2 Page Titled A missing or empty title is found automatically. Whether it describes the page needs a person. A Partly automated

What still needs a person

No automated tool can confirm these. AccessGuard marks related findings as Review, so nobody mistakes them for a pass.

  • Whether the page title describes the page and its site.
  • Short phrases in another language that don't need marking, such as names.

Questions

Which language code should I use?

A valid BCP 47 code, such as en, en-GB, es or de. The primary code on its own is enough for most sites.

Does the lang attribute help SEO?

Search engines mainly use the content and hreflang tags, but a correct lang attribute is still the standard way to declare the language, and screen readers rely on it.

Why is the page title in this check?

The title and the language live in the same part of the page, and both are quick to fix. WCAG 2.4.2 needs a title that describes the page.

Check a client page for page language and title issues

The free audit runs this check and every other one. Results in about a minute.