Page language
Every page should declare what language it is written in, so that browsers and know how to read it. Silktide reports pages that do not declare a language at all.
Why this matters
A chooses its pronunciation rules from the page's declared language. Without one, it guesses - often from the user's own settings - and a wrong guess makes every word sound mangled. Imagine English pronunciation applied to an entire German page: the word "die" comes out as the English "die" instead of "dee", and so on for every sentence.
Browsers also use the declared language for translation offers, spell-checking, and font selection, and search engines use it to serve pages to the right audience, so an undeclared language can hurt visibility too.
This is success criterion 3.1.1 (Language of Page), a requirement - part of the most basic conformance level.
How to fix it
Add a lang attribute to the page's opening
tag, using the language code for the page's main
language:
<!-- Problem: no language declared -->
<html>
<!-- Fix: declare the language -->
<html lang="en-GB">
Use a valid two-letter language code, optionally followed by a region, such as
en, en-GB, fr, or de-AT. In most website platforms this is set once in
the page template. Declaring the correct language per page also improves how
Silktide tests your content - see how languages work.
How Silktide tests this
- Find the
<html>element of each page. - Report the page if it has neither a
langattribute nor anxml:langattribute. - Whether the declared value is valid is tested separately by the Invalid language for page check.