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:

Expectation

  1. The [primary language tag][] of the lang attribute of the test target matches the default language of the page.

    The mean by which the default language of the page is computed is not specified as part of this rule.

Assumptions

This rule makes the following assumption:

  • The [lang][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][lang attribute] 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][lang attribute] 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][lang attribute] 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][lang attribute] 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://act-rules.github.io/rules/ucwvc8/. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).