Home

Even Grounds, Accessibility Consulting

Making web sites, documents, software and hardware accessible to people with disabilities. Accessibility, WCAG and Section 508 compliance testing and auditing.

  • Services
  • About Us
  • Customers
  • Contact Us
  • Articles
  • Blog
  • Developers' Corner
  • Press
  • Resources

Are You Receiving the Accessibility Tips and Tricks?

  • Learn to make information accessible to people with disabilities
  • Implement what you learn right away
  • Understand how people with disabilities use technology
  • Receive our monthly newsletter packed with news, articles and updates
  • Bonus workbook: Ten steps to a more accessible web site


Do you need help with accessibility? Hire us!

Defining The Language of Your Web Page

  • Developers' Corner
  • Language

When you create a web page, it is not enough to write in a particular language. It is also important to programmatically define the language you are using.

How to Define the Language of your Pages

This task is actually very simple. You only need to place the lang attribute in the <HTML> tag of your page. The value of your lang attribute is the language of your page.

Here is a sample code of an HTML tag with the lang attribute:

<html lang=”en”>

In this example, the lang attribute has a value of “en”, which represents English.

A complete list of language codes is available at the HTMLQuick.com site.

Important note: the above example is appropriate only for pages having one default language.

If you have a page that has content in more than one language, here is what you can do. First, define the default language using the format above. Then, locate the contents displayed in another language and define the language for them.

Here is an example: Let us say you are creating an English-German dictionary. The default language of your page is English, but it has a number of words in German.

You first have to define your default language:

<html lang=”en”>

Then find the words in German and define their language. In this example, the German word for “airplane” is in the <p> tag.

<p lang=”de”>
Flugzeug
</p>

An Illustrative Example

Below is a table containing five words in English with their corresponding meanings in German. This table makes use of the lang attribute. So, if you use a screen reader and listen to the German words, you would hear it pronounce the words in a German accent.

Five English words and their translations in German
English German
Airport Flughafen
Dog Hund
Friend Freund
Hospital Krankenhaus
Water Wasser

Here is an audio version of this small dictionary which opens in a new window, so you can listen to how a screen reader reads the words in the table.

Why Define the Language of Your Page

As shown in the previous example, assistive technology would be able to represent information more accurately if you define your page’s language. This contributes a good deal to the accessibility of your website. Your site will also be displayed more accurately in search results. Search engines such as Google provide their users a way to search for websites in a particular language. If you define the language of your pages, more people would be able to find your website.

Bookmark/Search this post with:
  • Delicious
  • Digg
  • StumbleUpon
  • Facebook
  • Google
  • Yahoo
  • Technorati

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

This blog uses CommentLuv plugin which will try and parse your sites feed and display a link to your last post, please be patient while it tries to find it for you
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Accessibility Tips and Tricks


RSS

  • Articles
  • Blog
  • Developers' Corner
  • News
  • Press

Follow us on Twitter, YouTube, or on Facebook

You Might Also Like:

  • Making the iPhone Keyboard Accessible
  • Save a Lot by Choosing the Right Widgets
  • Pages Opening in a New Window
  • Free Screen Readers
  • The Secret of Making PDF Documents Section 508 Compliant Much Faster

Top Commentators

  • Transcription Services (5)
  • Kizi (4)
  • nike shox pas cher (4)
  • guest (4)
  • annahwillis (3)
  • estetik burun (3)
  • kizi (3)
  • Mikayla (2)
  • Poornima (2)
 

Privacy Policy

Copyright 2007-2011 - Even Grounds Inc., Accessibility Consulting