ibin
Usually serious2 minute read

Set the language of each page

Tell browsers and assistive technology which language the page uses.

Why it matters

Screen readers may pronounce words incorrectly when the document language is missing.

How to fix it

  1. Add a lang attribute to the opening html element.

  2. Use the language used by most of the page, such as en or nl.

  3. Mark passages in another language with their own lang attribute.

Example

Before
<html>
  <head>
    …
  </head>
</html>
After
<html lang="en">
  <head>
    …
  </head>
</html>

How to check your fix

Check your page again with ibin. The issue disappears from your report once every place is fixed. Then try it yourself the way a visitor would.

  • Check the page again and make sure the issue no longer shows up in your report.
  • Try the fixed part yourself: with a mouse, with only a keyboard, and zoomed in.
  • If you can, ask someone who uses a screen reader to try it too.
For your developer

Standards: WCAG 3.1.1 (A)

html-has-lang · Background information (in English)

Also available in Nederlands, Français, Deutsch