Intended audience: users, HTML coders, script developers, CSS coders, Web project managers, and anyone who wants to know how language declarations work in current browsers.
Updated
These tests check whether user agents recognize language declarations for HTML documents, and apply the expected prioritisation in case of mismatches between multiple declarations.
To see the test, click on the link in the left-most column. To see detailed results for a single test, click on a row and look just above the table. The detailed results show the date(s) the test result was recorded, and the version of the browser tested.
Any dependencies are shown in notes above the table, and notes below the table will usually provide any additional useful information, including an explanation of why a result was marked as 'partially successful'.
Key:
pass | fail | partially successful |
Note that these test results are for released versions of the browsers tested. Versions that are still in development may provide better support for these features. The tests do not use any vendor prefixes. Tests that do show support for vendor prefixes are listed further down this page.
Link (to run test) | Assertion | Firefox | Chrome | Opera | Safari | Edge | IE |
---|---|---|---|---|---|---|---|
lang attribute in html tag the-lang-attribute-001.html |
The browser will recognize a language declared in a lang attribute on the html tag. | pass | pass | pass | pass | pass | pass |
xml:lang attribute in html tag the-lang-attribute-002.html |
The browser will NOT recognize a language declared in an xml:lang attribute on the html tag. | pass | pass | pass | pass | pass | pass |
HTTP header the-lang-attribute-003.html |
The browser will recognize a language declared in the HTTP header, when there is no internal language declaration. | pass | pass | pass | pass | pass | pass |
pragma-set default the-lang-attribute-004.html |
The browser will recognize a language declared in a meta element in the head using http-equiv="Content-Language" content=".." (with a single language tag value), when there is no other language declaration inside the document. | pass | pass | pass | pass | pass | pass |
Links: Section 3.2.3.3 • Related tests
Dependencies
Link (to run test) | Assertion | Firefox | Chrome | Opera | Safari | Edge | IE |
---|---|---|---|---|---|---|---|
HTTP header and html lang the-lang-attribute-005.html |
If there is a conflict between the language declarations in the HTTP header and the html element using lang, the browser will recognize the language declared in the html element. | pass | pass | pass | pass | pass | pass |
HTTP header and meta element the-lang-attribute-006.html |
If there is a conflict between the language declarations in the HTTP header and the Content-Language meta element, the UA will recognize the language declared in the meta element. | pass | pass | pass | pass | pass | pass |
html lang and meta elements the-lang-attribute-007.html |
If there is a conflict between the language declared using lang in the html element and that in the meta element, the UA will recognize the language declared in the html element. | pass | pass | pass | pass | pass | pass |
Links: Section 3.2.3.3 • Related tests
Dependencies
Link (to run test) | Assertion | Firefox | Chrome | Opera | Safari | Edge | IE |
---|---|---|---|---|---|---|---|
lang="..." vs lang="" the-lang-attribute-008.html |
If an element contains a lang attribute with an empty value, the value of a lang attribute higher up the document tree will no longer be applied to the content of that element. | pass | pass | pass | pass | pass | pass |
lang="" vs HTTP the-lang-attribute-009.html |
If the HTTP header contains a language declaration but the html element uses an empty lang value, the UA will not recognize the language declared in the HTTP header. | pass | pass | pass | pass | pass | pass |
lang="" vs meta Content-Language the-lang-attribute-010.html |
If the meta Content-Language element contains a language declaration but the html element uses an empty lang value, the UA will not recognize the language declared in the meta Content-Language element. | pass | pass | pass | pass | pass | pass |
Links: Section 3.2.3.3 • Related tests
Dependencies
Link (to run test) | Assertion | Firefox | Chrome | Opera | Safari | Edge | IE |
---|---|---|---|---|---|---|---|
Multiple languages in HTTP header the-lang-attribute-011.html |
[Exploratory] The browser will not recognize a language declaration in the HTTP Content Language header when more than one language is declared. | fail | fail | fail | fail | pass | pass |
Multiple languages in Content-Language meta element the-lang-attribute-012.html |
The UA will not recognize a language declaration in the Content-Language meta element when more than one language is declared. | fail | pass | pass | pass | pass | pass |
Links: Section 4.2.5.3 • Related tests
Notes