Theme
Language
Telling screen readers which language to speak. 4 automated checks Websight runs, each with a live example and a fix you can copy.
The page must say what language it is in
html-has-langThe lang attribute on the html element tells browsers and screen readers which language the page is written in. Screen readers use it to pick a voice: an English page read by a French voice is close to gibberish. Translation tools, spell checkers and hyphenation use it too. It is one attribute and it belongs on every page.The page language code must be validhtml-lang-validA lang attribute only works if its value is a real language tag: a two or three letter code like en, cy or fr, optionally followed by a hyphen and a region, like en-GB. Anything else is ignored, which is the same as having no lang at all. The screen reader falls back to its default voice.lang and xml:lang must name the same languagehtml-xml-lang-mismatchSome pages, usually ones generated as XHTML or from older templates, carry both a lang attribute and an xml:lang attribute on the html element. Browsers read lang; XML tools read xml:lang. If they disagree, different software picks a different language for the same page. The check compares the base language of each: en and en-GB agree, en and fr do not.Language codes on page sections must be validvalid-langWhen part of a page is in a different language from the rest, put a lang attribute on that element. Screen readers switch to the right voice for that section and back afterwards. The code must be a valid language tag; lang="welsh" or lang="fr_FR" is ignored, so the section is read in the wrong voice.Who these pages are for: the developer or site owner who has a scan result in front of them and wants to understand it, test it and fix it without a training course.
Keep going
Check your page for language issues
Websight runs these checks on any page in Chrome and shows a draft fix for each element it finds.
Add Websight to ChromeFree scans, no account, nothing leaves your computer. Automated tools find only part of the problems; the extension says so on every report.