Penn State Homepage

Teaching and Learning with Technology

Creating Accessible Web Sites

This Page

  1. Synopsis
  2. HTML Entity Codes
  3. LANG Tag
  4. Common Language Codes
  5. Other Ways to Signal Non-English Content

Synopsis

Foreign language support is still relatively incomplete for screen readers, but here are some things that can be done. Screen readers programmed in a non-English language may be able to switch to English easier than a screen reader designed for a U.S. audience can switch to non-English.

  1. Use HTML entities for accented letters instead of inputting special letters directly of "text formatting hacks" whenever possible.

  2. Use the LANG tag to mark words or passages of text in another language. This works for major languages only.

  3. Consider placing long passages of a non-English text on its own page with language identifier (in English and in the native language) and link to siwtch language page near the top of each page.

  4. Use a textual indication (visual or hidden) to indicate when a foreign language word or passage is coming.

  5. If developing a completely or partially non-English Web page, make sure it is properly encoded. See the Penn State Computing with Accents page for more details.
    Note: Some screen readers may need plug-ins for some languages like Chinese and Russian (if available).

  6. For some lesser taught languages such as Swahili or Old Irish, true accessibility can only be accomplished via an audio file because screen readers may not be able to read the words correctly.

Top of Page

HTML Entity Codes

For accented letters use entity codes such as è for French è or £ for the British pound sign (£).

Avoid directly inputting special characters into theHTML document as they may not be parsed correctly by older browsers or screen readers.

Use Entity Codes

<b>&pound;</b> - makes a bold face pound sign

 

Don't Directly Input Special Characters

<b>£</b> - Results are unpredictable across browsers or screen readers.

 

Also avoid "text hacks" like <i><strike>L</strike></i> (L) for £; an example like this would be read as L or strike L, not as a pound sign.

Top of Page

LANG Tag

The LANG attribute is designed to signal screen readers to switch to another language. It is currently supported by only a few screen readers and only for the major languages, but could be more widely supported in the future.

NOTE: You must also declare the encoding in addition to the language. The language and its script are independent.

Declaring Page Language

The official W3C recommendation is to declare the primary language for each Web page with a <...lang => attribute in the <html> tag. Codes are ISO-639 Language codes.

 

Declaring a U.S. English Page (Penn State)

<html lang="en-US">

...

</html>

 

Declaring a British English Page

<html lang="en-GB">

...

</html>

Screen readers supporting this tag could switch to a British accent.

 

Declaring a French Page

<html lang="fr">

...

</html>

Screen readers supporting this tag could switch to a French accent.

 

Switching Languages

If you switch languages within one page, you can embed the LANG attribute in other tags such as a P, TD, SPAN, DIV and other tags. For example

Test Text with Lang Tags

This sentence is in default American English.

This sentence will be read with a British accent.

Esta frase es en español. (Spanish)

Cette phrase est en français. (French)

Mae'r frawddeg hon yn cymraeg. (Welsh - Not Supported)

View the Code

<p> This sentence is in English. </p>

<p lang="en-GB"> This sentence will be read with a British accent </p>

<p lang="es"> Esta frase es en espa&ntilde;ol. </p> (Spanish)

<p lang="fr"> Cette phrase est en fran&ccedil;ais </p> (French)

<p lang="cy"> Mae'r frawddeg hon yn Cymraeg. </p> (Welsh, not supported) </p>

Top of Page

Common Language Codes

ISO-639 language codes for languages taught at Penn State. See the Library of Congress and a complete list of ISO-639 Language Codes for more information.

These languages are supported by U.S. Version Homepage Reader 3 and Jaws 5.0:

Screen readers or screen reader plug-ins designed for specific languages may also be available and may provide support for additional language tags, although not all languages may have an available plug-in. Some additional language tags include:

See the Library of Congress Language Code Page for a complete list of codes.

Top of Page

Other Ways to Signal Non-English Content

In addition to using the LANG tag, you can also include an indication in the text so that users of older screen readers can manually with languages. This can be done by spelling out the beginning/end of a passage in the text (preferably in an H1,H2 tag or as part of a set of links) or in the alt tag of an invisible graphic.

 

Spelling Out Language Name in Text

Translations of U.N. Universal Declaration of Human Rights

Spanish | French ... (Menu provides quick list of where non-English passages are)

Spanish Article 1 (Spelling it Out)

Artículo 1
Todos los seres humanos nacen libres e iguales en dignidad y derechos y, dotados como están de razón y conciencia, deben comportarse fraternalmente los unos con los otros.

French Article 1

Article premier
Tous les êtres humains naissent libres et égaux en dignité et en droits. Ils sont doués de raison et de conscience et doivent agir les uns envers les autres dans un esprit de fraternité.

 

 

With Invisible Graphics

Artículo 1
Todos los seres humanos nacen libres e iguales en dignidad y derechos y, dotados como están de razón y conciencia, deben comportarse fraternalmente los unos con los otros.

View the Code

<img src="transpixel.gif" alt="Begin Spanish">

Top of Page

Links on Foreign Language Accessibility

Specific Languages

 

Top of Page

Site Menu: Home Page/Main Menu | Section 508 Guidelines | Quick Checklist | Details by Tag
| Links | I.T.S. Seminar Page | Sitemap


©1999-2006 Pennsylvania State University.

This Web page is hosted by (by Teaching and Learning with Technology, a unit of Information Technology Services. Please contact the Webmaster if you have any questions.

Last Update: Monday, 29-Aug-2005 16:29:56 EDT