Language details
Does the HTML of the home page state the language of the content?
What we check
We read the lang attribute in the <html> element of the home page, e.g. <html lang="de-CH">. If it is missing, we give a note. We also show whether the page refers to language versions with hreflang. Whether these details are correct is checked by the article on language versions.
Why it matters
The language setting is a small detail with surprisingly much effect:
- Screen readers choose voice and pronunciation based on it. If it is missing, a screen reader set to English reads the German text with English pronunciation, and nobody understands it.
- Browsers offer automatic translation when the page language does not match the visitor's language. Wrong or missing details lead to unnecessary or missing translation offers.
- Search engines and AI services usually recognise the language themselves, but use the setting as confirmation.
- Hyphenation and spell checking in the browser follow the language.
The language setting is also a requirement of the WCAG accessibility guidelines and thus also part of standards such as EN 301 549 that public websites have to meet.
How to fix it
The <html> element of every page should name the language of its content:
<html lang="de-CH">
Common codes are en, en-US, en-GB, de-DE or fr-CA. Use the language code first, then the country code. ch alone is not a valid language code.
WordPress
Set the language under "Settings › General › Site Language". The theme then takes it over into the lang attribute. If it is missing nevertheless, the theme does not output the language. Then switching to a current theme or a small adjustment by the agency helps.
Wix, Jimdo, Squarespace
The language is defined in the website settings, usually under "Language and region". On multilingual Wix websites Wix sets the entry per language version.
How to check it yourself
Open the page source. In the first or second line there is <html …>. There it should say lang="de-CH" or a similar entry.
Frequently asked questions
Should I specify "de" or "de-CH"?
Both are valid. "de-CH" additionally says that the text is written for Switzerland, for example with "ss" instead of "ß". This helps translation functions and screen readers with pronunciation.
My website is multilingual. Which language do I specify?
Every page specifies its own language: the French page "fr-CH", the German one "de-CH". How the pages belong together is handled by hreflang.
Check a website now
We check "Language details" and all other points in a few minutes, free and without sign-up.
Related topics
-
Language versions (hreflang)
Are the language versions of a multilingual website linked to each other correctly?
-
Accessibility (automatic preliminary check)
Which barriers does an automatic test find on the home page, such as missing image descriptions or too little contrast?
-
Semantic HTML structure
Does the home page mark up the header, navigation, main content and footer with the appropriate HTML elements?
-
Page title
Does the home page have a meaningful title that names its topic?