Language Changes in Web Resources
Marking up language changes is critical for screen readers and other speech renderings of web resources. Many speech synthesizers support mutliple languages and they need information on changes in language to switch pronounciations. When changes in language are not included, speech renderings become confusing and unintelligible, similar to the visual confusion that occurs when a character set is not available apparently random characters appear on the screen.
HTML Markup
:lang- The
langattribute can be used on almost all elements to define the intended langauge of the element's content. The two or five-character language codes used in HTML 4.01 can be found at [RFC1766]
Related Accessibility Requirements
Section 508
- There are no language markup requirements in the Section 508 requirements. This is a major ommission for accessibility since without language change information in the markup, speech synthesizers used by screen readers do not know when to switch languages
Web Content Accessibility Guidelines (WCAG 1.0)
- 4.1 Clearly identify changes in the natural language of a document's text and any text equivalents (e.g., captions). [Priority 1]
- 4.3 Identify the primary natural language of a document. [Priority 3]
Examples
- English
- This sentence is written in English
- German
- Dieses ist Satz ist auf Deutsch
- French
- Cette phrase est crite en franais
- Spnaish
- Esta oracin se escribe en espaol
HTML Source Code
<dl>
  <dt>English</dt>
  <dd lang="en">This sentence is written in English</dd>
  <dt>German</dt>
  <dd lang="de">Dieses ist Satz ist auf Deutsch</dd>
  <dt>French</dt>
  <dd lang="fr">Cette phrase est crite en franais</dd>
  <dt>Spnaish</dt>
  <dd lang="es">Esta oracin se escribe en espaol</dd>
</dl>
  <dt>English</dt>
  <dd lang="en">This sentence is written in English</dd>
  <dt>German</dt>
  <dd lang="de">Dieses ist Satz ist auf Deutsch</dd>
  <dt>French</dt>
  <dd lang="fr">Cette phrase est crite en franais</dd>
  <dt>Spnaish</dt>
  <dd lang="es">Esta oracin se escribe en espaol</dd>
</dl>