Skip to content

This translation has not been editorially reviewed yet. The German version is authoritative. Deutsche Fassung →

Checking language markup: setting the lang attribute correctly

Every page must state its language in the code, and foreign-language sections must be individually marked up. Screen readers use this to choose their pronunciation — without it, English text gets read aloud with German pronunciation rules and is barely understandable.

  • This criterion is cheap to meet and still often overlooked, especially on bilingual websites: the English version inherits the template's lang="de". This nearly happened to us ourselves when building the English page.
  • For individual words, use judgement. Established loanwords need no markup; a whole English paragraph or a foreign-language quote does.

FAQ

What happens without the lang attribute?

The screen reader uses its default setting. With German text and an English default — or the other way round — the resulting pronunciation is barely understandable.

Do we have to mark up every foreign word?

No. Established loanwords and proper names are exempt. What needs marking up are sections actually written in another language.

Deutsche Fassung — mit allen Prüfpunkten dieses Themas