| Title | Correct language codes and contradictory (and incorrect) subcodes for content in British English |
|---|---|
| Description | A page with content in British English.
The xml:lang attribute on the html element contains the value ("en-UK"), which is not correct for British English ("en-GB"); the lang attribute contains the language and subcode for American English ("en-US").
|
| Creator | BenToWeb (Christophe.Strobbe@…) |
| Rights | Copyright BenToWeb 2005-2007 |
| Language | English |
| Date | 2005-09-02 |
| Status | accepted QA |
Technologies are markup languages or data formats. If the technology is a markup language, “features” refers to elements and attributes.
XHTML™ 1.0 The Extensible HyperText Markup Language (Second Edition)
Feature: lang
(namespace: http://www.w3.org/1999/xhtml)
.
Technical specification:
Specifying the language of content: the lang attribute
.
This test case is intended to fail because the primary natural language is correctly defined but the language version information is contradictory and one of the language subcodes does not exist. Subcodes to identify versions of languages are not required but should be correct when they are used. However, tests may show that contradictory and even incorrect information on language versions is not confusing.
This test case can be evaluated automatically when using a test tool with reliable automatic language recognition for British and American English, support for lang and xml:lang attributes and language tags.
Automatic evaluation.
“Rules” refer to success criteria in WCAG 2.0, checkpoints in WCAG 1.0 and similar requirements.
The test case fails the following success criterion at line 3, column 44: http://www.w3.org/TR/2006/WD-WCAG20-20060427/guidelines.html#meaning-doc-lang-id.
The test case fails the following success criterion at line 3, column 61: http://www.w3.org/TR/2006/WD-WCAG20-20060427/guidelines.html#meaning-doc-lang-id.
The browser cannot find the primary language of the document.
The lang and xml:lang attributes in the html element contradict each other, and xml:lang="en-UK" does not contain a valid language code.
(In Mozilla 1.7.3, the lang attribute takes precedence over the xml:lang attribute, so the language is incorrectly identifed as American English.)
This test case maps to technique H57: Using the lang attribute of the html element (http://www.w3.org/TR/2006/WD-WCAG20-TECHS-20060427/Overview.html#H57).
Note that when both lang and xml:lang are specified,
the value of xml:lang takes precedence:
see "The lang and xml:lang Attributes" in the XHTML specification (http://www.w3.org/TR/xhtml1/#C_7).
The test case fails the following success criterion at line 3, column 44: http://www.w3.org/TR/2006/WD-WCAG20-20050630/#meaning-doc-lang-id.
The test case fails the following success criterion at line 3, column 61: http://www.w3.org/TR/2006/WD-WCAG20-20050630/#meaning-doc-lang-id.
The browser cannot find the primary language of the document.
The lang and xml:lang attributes in the html element contradict each other, and xml:lang="en-UK" does not contain a valid language code.
(In Mozilla 1.7.3, the lang attribute takes precedence over the xml:lang attribute, so the language is incorrectly identifed as American English.)