Language

screenshot of HTML code
Figure 1: Example of a webpage code where English is the primary language and French is secondary language.

The language of a webpage or part of webpage is defined semantically to help screen readers to identify the language of the webpage.

The abbreviations defined in ISO 639-2 standard for various languages are used to define the language of the page. For more information on language codes, refer to ISO 639-2 Language Code List - Codes for the representation of names of languages (Library of Congress) .

An aria-label SHOULD NOT be used to define other language content on the page like specifying accessible name to the controls as it doesn’t get translated when the webpages are localized in different languages.

NOTE:

  • New to accessibility or uncertain of requirements, it will be helpful to review all sections below.
  • Already familiar with requirements, skip to the “Working Example” section for sample HTML, CSS and JavaScript (when needed), along with a working demo.