Accessible Information
Language - Web Access Centre
Summary: Speech or braille output cannot identify language changes in a page unless indicated in the code.
- Rationale
- Techniques
- Testing tips
- Further information
- Website Accessibility Initiative compliance
- Other pages about text
Rationale
Synthesised speech software is becoming more and more sophisticated with every new browser and screen reader version released. 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.
For speech software to handle languages correctly, however, the language used in the pages needs 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.
Techniques
- The main language, also referred to as the natural language, of the page should be indicated above the HEAD of the page source code. For example an English page should be marked up with Lang=”en” in the meta data, as shown below:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html40/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Ensure your page is encoded using the correct language code. Currently we use ISO 639.2, the two letter codes. Three letter codes, “eng” for example, are valid but the W3C recommend two letter tags as they are backward compatible. The language codes can also consist of two bits ie eng-us. These additional codes define variations in that particular language and are acceptable.
- Language changes, including single words, quotes or paragraphs of text written in a foreign language, must be indicated using the LANG tag.
- Images of text displaying languages are not generally encouraged especially for languages that are easy to code such as languages using Roman text. Languages using different scripts such as Cantonese, Punjabi and Arabic can be problematic however so in some cases images can be acceptable for small amounts of text.
Testing tips
Verify that changes in language on a page are flagged up by using the LANG attribute.
- Accessibility toolbar - Doc Info - Show Lang attributes.
- Browser - View - Source. Edit - Find "lang" or the text that is a different language.
Further information
- More information can be found on the W3C Internationalization website.
- A full list of currently supported language codes can be found on the US Library of Congress.
Website Accessibility Initiative compliance
- 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
- 11.3 Provide information so that users may receive documents according to their preferences (eg language, content type, etc.) Priority 3
For more information on techniques visit the Web Accessibility Initiative techniques page.
Other pages about text
Back to Design & Build
For Web Access Centre updates email webaccess@rnib.org.uk
Content author: webaccess@rnib.org.uk
Last updated: 18/12/2008 12:36
Accessible Information contents
More info
In your area
Related info
Your stories
Rachael Anne's story - Throughout her childhood, Rachael Anne moved house several times. It wasn't always easy to adjust to new schools and new places, but that didn't stop her developing talents in acting and music. She is now a trainee Family Services Officer at RNIB Birmingham. "Even when life is tough, anything is possible and you should never give up." Rachael Anne's full story