SIA-R109HTML page language subtag matches default language
Accessibility requirements
This rule tests conformance of the following accessibility requirements:
Description
This rule checks that the primary language subtag of the page language matches the default language of the page
Applicability
This rule applies to any document element if it is an <html>
element in the HTML namespace for which all of the following are true:
- The document element has a
lang
attribute which is a valid language tag; and - The document element is in a top-level browsing context; and
- The document element has a content type of
text/html
.
Expectation
-
The primary language subtag of the
lang
attribute of the test target matches the default language of the page.
Assumptions
This rule makes the following assumption:
- The
lang
attribute is being used to conform to WCAG. As such, this rule doesn't test if the attribute is needed to conform to WCAG.
Accessibility Support
There are no major accessibility support issues known for this rule.
Examples
Passed
These lang
attributes match the default language of the page they are in.
The default language is English because all words are in English.
<html lang="en">
<head>
<title>ACT Rules Format 1.0 - Abstract</title>
</head>
<body>
<p>
The Accessibility Conformance Testing (ACT) Rules Format 1.0 defines a format for writing accessibility test
rules. These test rules can be used for developing automated testing tools and manual testing methodologies. It
provides a common format that allows any party involved in accessibility testing to document and share their
testing procedures in a robust and understandable manner. This enables transparency and harmonization of testing
methods, including methods implemented by accessibility test tools.
</p>
</body>
</html>
The default language is English because all but a few words are in English.
<html lang="EN">
<head>
<title>Gelukkig</title>
</head>
<body>
<p>The Dutch word "gelukkig" has no equivalent in English.</p>
</body>
</html>
The default language is Dutch because all English words are enclosed in another lang
attribute.
<html lang="nl">
<head>
<title>Met de kippen op stok</title>
</head>
<body>
<blockquote>
<p>"Hij ging met de kippen op stok"</p>
</blockquote>
<p lang="en">
This Dutch phrase literally translates into "He went to roost with the chickens", but it means that he went to bed
early.
</p>
</body>
</html>
Failed
The default language of this page is English, but the lang
is set to Danish.
<html lang="da">
<head>
<title>ACT Rules Format 1.0 - Abstract</title>
</head>
<body>
<p>
The Accessibility Conformance Testing (ACT) Rules Format 1.0 defines a format for writing accessibility test
rules. These test rules can be used for developing automated testing tools and manual testing methodologies. It
provides a common format that allows any party involved in accessibility testing to document and share their
testing procedures in a robust and understandable manner. This enables transparency and harmonization of testing
methods, including methods implemented by accessibility test tools.
</p>
</body>
</html>
The default language is English because all but a few words are in English; but the lang
is set to Dutch.
<html lang="nl">
<head>
<title>Gelukkig</title>
</head>
<body>
<p>The Dutch word "gelukkig" has no equivalent in English.</p>
</body>
</html>
Inapplicable
This is an SVG document, not an HTML document.
<svg xmlns="http://www.w3.org/2000/svg" lang="fr"></svg>
Implementation details
The rule is semi-automated, asking users to provide the default language of the page.
Acknowledgments
This document includes material copied from or derived from https://www.w3.org/WAI/standards-guidelines/act/rules/ucwvc8/. Copyright © 2024 W3C® (MIT, ERCIM, Keio, Beihang).