Language of page

This information relates to criterion 3.1.1 Language of page, which states:

The default human language of each Web page can be programmatically determined.

Why it matters

This is an easy thing to do but less easy to demonstrate why it matters. It is easier to understand if you have learned another language.

Every language has its own pronunciation rules. The sounds that make up each language are quite different and even though many languages use the same or similar alphabet, the letters within it are used to represent different sounds in speech. So if you try to read a foreign language using English phonic rules, it won't sound right at all.

When a screen reader reads a web page, it has to know which language to read it in. Most of the content on my website is in English but I often browse web pages in Finnish because we used to live in Finland. If I wanted JAWS to read these Finnish web pages, I would want it to be read with Finnish pronunciation so that I could understand it.

How JAWS reads Finnish

The following audio clip is JAWS reading a news page about the war in Ukraine. It is taken from the Plain Finnish news section of the YLE website Opens in new window The content of this page changes daily, so will no longer be the same. For this reason, I have provided some options for you to access the information that JAWS is reading:

How to achieve language of page

At the top of your html code, you should have the <html> element. This needs a lang attribute. Every language has been given a 2-digit code.

Language codes Opens in new window

So if the language of the page is English, the code should be like this:

<html lang="en">

And if the language of the page is Finnish, the code should be like this:

<html lang="fi">

Don't worry for now if there will be other languages used on the page. We will come onto this in the next WCAG criterion, language of parts.