1. Accessibility & Legislation
  2. Common Issues
  3. Testing & Tools
  4. Analysing Your Site

2.09 Common issues: Natural Language

From the Becta document

Synthesised speech software is becoming increasingly sophisticated. It is now possible to purchase different language modules to make it possible for speech browsers and screen readers to handle a growing range of languages. In order for speech software to handle languages correctly, however, when reading out web pages, the languages being used in pages needs to be identified. Additionally, It is also possible to have language translators convert foreign text into, for example, English and for this to work correctly the relevant languages need to be identified.

It is particularly important that any changes in the language being used are coded correctly to enable the speech synthesis software to pronounce the word(s) correctly, or to spell them out if the language is not one for which the user has installed the required software module.

The main language used in a web page can be indicated using the LANG attribute in the HTML tag, e.g.:<html lang="en"> would indicate that the main language being used is English. See the formal HTML specification on the W3C website for other 2-letter language codes link here (others include "fr" for French, "de" for German and "cy" for Welsh). The LANG attribute can also be used for individual words, phrases or paragraphs (e.g. if a foreign word or phrase is used, or foreign language material is quoted).

Simple Example

A web page displays the following text:

"And with a certain je ne sais quoi she entered both the room, and his life, forever. My name is Natasha she said. Piacere he replied in impeccable Italian, locking the door."

This would need to be coded in the following manner to ensure that it could be translated correctly:

<p>And with a certain <span lang="fr">je ne sais quoi</span>, she entered both the room, and his life, forever. <q>My name is Natasha,</q> she said. <q lang="it">Piacere,</q> he replied in impeccable Italian, locking the door.

The above example was taken from the W3C site (see link below).

WAI guidelines:

4.1 Clearly identify changes in the natural language of a document's text and any text equivalents (e.g., captions). For example, in HTML use the "lang" attribute. [NGfL requirement]

Further information:


Common issues