Identify language changes

Rule ID Language 2
Definition Elements with text content in a different language from the principal language of the page must use the lang attribute with a valid IANA language code to identify the change.
Purpose
  • Assistive technologies like screen readers and other speech output technologies need to know the language of the characters of an element to speak the text content correctly.
Required Yes for HTML4 Legacy Techniques ruleset mapping
WCAG Success Criteria

3.1.2 Language of Parts (Level AA, Primary Success Criterion)

Rule Category Styling/Content
Scope Page
Target Resources Elements with text content that is in a different language than the principal language of the page
  • [lang]
Techniques
  • Use the lang attribute to define the IANA language of the text content of the element.
  • Use the IANA codes to identify the language of the text in the element (e.g. en, fr, ...).
Manual Checks
  • Review the page for any text content in languages that are different than the principal language of the page.
  • If any changes in language are found, use the lang attribute to identify them.
Informational Links