Website Accessibility Guide

3.1.1 Language of Page

Written by MCS Accessibility Team | Jun 7, 2020 10:56:00 PM

Understanding 3.1.1

This is a simple one: you simply have to specify what language your website is in. This is important for users who require braille translation software so that the proper codes for certain characters is used, as well as speech synthesizer tools that support multiple languages or can translate from one language to another.

Beyond compliance for disabled users, identifying the default language helps all users use technology that translates foreign languages into their native one.

How HubSpot Helps

Almost all modern content management systems (CMS) and website platforms—HubSpot, WordPress, Squarespace to name just a few‚set the default language for you and give you a Settings option to change this if needed. 

Recommended Solutions

To set the language, you would add a snippet to your page's <html> tag.

Most language codes are just two characters, but you can use up to four characters to distinguish between regional dialects and provide a better experience for users with screen readers.

For example:

  • If your webpage is in American English: <html lang="en-us"> 
  • If your webpage is in British English: <html lang="en-gb">
  • If your webpage is in French: <html lang="fr"> 

 
Here you can find a full list of language codes.

You'll only ever declare one default language for your site, even if your site has content in multiple languages. If that's the case, whenever you have a page with content in another language, add a language attribute to an element around that content only:

<p>You'd say that in Spanish as <span lang="es">Crecer para Bueno</span>.</p>

If you have PDFs or Flash media available on your site, you'll also need to set the default language on each piece of content. Typically, this is done by default in your software (i.e. Adobe Acrobat Pro automatically sets your default language in the export settings in Advanced > Reading Options > Language.)