Language

Use correct language attributes for accessibility.

Impact

(How ScanGov measures tasklist priorities.)

Why it's important

Using the correct language attributes enables screen readers to pronounce text correctly and improves accessibility for non-native speakers.

User stories

As a multilingual user or screen reader user, I want the correct language to be defined on the website so that the content is read and interpreted accurately by assistive technologies.

Error

(ScanGov messaging when a site fails a standard)

Language attribute is missing or incorrect.

About

Follow these recommendations to improve the experience for visitors who may take advantage of translations.

  1. <html> element has a [lang] attribute: If a page doesn’t specify a lang attribute, a screen reader assumes that the page is in the default language that the user chose when setting up the screen reader. If the page isn’t actually in the default language, then the screen reader might not announce the page’s text correctly.

  2. <html> element has a valid value for its [lang] attribute: Specifying a valid BCP 47 language helps screen readers announce text properly.

  3. <html> element has an [xml:lang] attribute with the same base language as the [lang] attribute: If the webpage does not specify a consistent language, then the screen reader might not announce the page’s text correctly.

  4. [lang] attributes have a valid value: Specifying a valid BCP 47 language on elements helps ensure that text is pronounced correctly by a screen reader.

Guidance

Indicator

Feedback