Skip to main content

30 steps to a more accessible website

Step 7: Identifying your language

You know what language you're writing in, so tell your readers… and their software.

Who benefits?

  1. Jackie benefits. Her screen reader software (JAWS) needs to know what language your pages are written in, so it can pronounce your words properly when it reads them aloud. If you don't identify your language, JAWS will try to guess what language you're using, and it can guess incorrectly, especially if you quote source code or include other non-language content in your pages.
  2. Google benefits, even if you are writing in English, but especially if you are writing in some other language. According to the Google Zeitgeist, 50% of Google users search in languages other than English, and many of these users specify in their Google preferences to only search for pages in specific languages. Google's language auto-detection algorithms are better than most, but why make Google's job more difficult?

How to do it

SiteBuilder pages all have the two-character code for English en inserted into them by default, so for the most part, users do not have to take any action to identify the language they are using. If you are using SiteBuilder to publish pages that are not in English, then please contact the Web Team to discuss how to include the appropriate language code for your pages.

Like the DOCTYPE, you should identify your language on every page of your website.

One additional note: if you have more than one language on a page, you can identify the language on any enclosing element. For instance, if your website uses HTML 4 and is primarily in German, but you quote an article in English, you could mark it up like this:

<html lang="de">  ...  <blockquote lang="en">    ...  </blockquote>

Further reading

« Step 6: Choosing a DOCTYPE | Contents | Step 8: Meaningful page titles »

This guide is adapted from Dive Into Accessibility by Mark Pilgrim and is shared with the GNU Free Documentation License v1.1