Hreflang and international · Language

Mismatched lang and xml:lang

The html element on this page has lang="en-GB" and xml:lang="fr". The two attributes name different languages, so the page's language is unclear.

How this page is built

The opening html tag of this page has two language attributes. The lang attribute says en-GB, which is right, and the xml:lang attribute says fr, which is wrong. Both attributes sit on the same element, so they claim to describe the same text.

This page has no hreflang annotations, so the only fault is the conflict between the two attributes.

Why it matters

The xml:lang attribute comes from XHTML. HTML allows it only if its value matches lang. When the two disagree, browsers and assistive technology may use either, and accessibility checks fail. A screen reader might read the English text with French sounds.

How to check it

View the source and compare the lang and xml:lang attributes on the html element. Accessibility checkers report a mismatch.

How to fix it

Remove xml:lang, which is not needed in HTML, or set it to the same value as lang.

Back to all tests