Step 7: Identifying your language
You know what language you're writing in, so tell your readers… and their software.
- 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.
- 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>
- List of language codes
- The lang attribute in the HTML specification
- Jim Thatcher on lang attribute support in screen readers. He describes their language auto-detection algorithms as "flaky", and he would know, since he designed the algorithm for Home Page Reader. Other screen readers have added support for the lang attribute since his comments were written, but their auto-detection algorithms are still flaky, making it even more important and useful to identify your language.