
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
96 lines
2.2 KiB
Plaintext
96 lines
2.2 KiB
Plaintext
== Why is this an issue?
|
||
|
||
The ``++<html>++`` element should provide the ``++lang++`` and/or ``++xml:lang++`` attribute in order to identify the default language of a document.
|
||
|
||
|
||
It enables assistive technologies, such as screen readers, to provide a comfortable reading experience by adapting the pronunciation and accent to the language. It also helps braille translation software, telling it to switch the control codes for accented characters for instance.
|
||
|
||
|
||
Other benefits of marking the language include:
|
||
|
||
* assisting user agents in providing dictionary definitions or helping users benefit from translation tools.
|
||
* improving https://blogs.bing.com/webmaster/2011/03/01/how-to-tell-bing-your-websites-country-and-language/[search engine ranking].
|
||
|
||
Both the ``++lang++`` and the ``++xml:lang++`` attributes can take only one value.
|
||
|
||
|
||
|
||
|
||
|
||
=== Noncompliant code example
|
||
|
||
[source,html]
|
||
----
|
||
<!DOCTYPE html>
|
||
<html> <!-- Noncompliant -->
|
||
<head>
|
||
<title>A page written in english</title>
|
||
<meta content="text/html; charset=utf-8" />
|
||
</head>
|
||
|
||
|
||
<body>
|
||
...
|
||
</body>
|
||
</html>
|
||
----
|
||
|
||
|
||
=== Compliant solution
|
||
|
||
[source,html]
|
||
----
|
||
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<title>A page written in english</title>
|
||
<meta content="text/html; charset=utf-8" />
|
||
</head>
|
||
|
||
|
||
<body>
|
||
...
|
||
</body>
|
||
</html>
|
||
----
|
||
|
||
[source,html]
|
||
----
|
||
<!DOCTYPE html>
|
||
<html lang="en" xml:lang="en">
|
||
<head>
|
||
<title>A page written in english</title>
|
||
<meta content="text/html; charset=utf-8" />
|
||
</head>
|
||
|
||
|
||
<body>
|
||
...
|
||
</body>
|
||
</html>
|
||
----
|
||
|
||
|
||
== Resources
|
||
|
||
* https://www.w3.org/TR/WCAG20-TECHS/html.html#H57[WCAG2, H57] - Using language attributes on the html element
|
||
* https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0#qr-meaning-doc-lang-id[WCAG2, 3.1.1] - Language of Page
|
||
|
||
ifdef::env-github,rspecator-view[]
|
||
|
||
'''
|
||
== Implementation Specification
|
||
(visible only on this page)
|
||
|
||
=== Message
|
||
|
||
Add "lang" and/or "xml:lang" attributes to this "<html>" element
|
||
|
||
|
||
=== Highlighting
|
||
|
||
Highlight the <html> element
|
||
|
||
|
||
endif::env-github,rspecator-view[]
|