Skip to content

Add link to "Declaring language in HTML" to 3.1.1, 3.1.2, H57, H58 #4462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions techniques/html/H57.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<body>
<h1>Using the language attribute on the <code class="language-html">HTML</code> element</h1>
<section class="meta">
<p class="id">ID: H57</p>
<p id="sc">3.1.1 Language of Page</p>
<p class="technology">Technology: html</p>
<p class="type">Type: Technique</p>
<p class="id">ID: H57</p>
<p id="sc">3.1.1 Language of Page</p>
<p class="technology">Technology: html</p>
<p class="type">Type: Technique</p>
</section>
<section id="applicability">
<h2>When to Use</h2>
Expand All @@ -33,12 +33,12 @@ <h2>Examples</h2>
<h3>Defining the content of an HTML document to be in French</h3>
<div lang="fr">
<pre xml:space="preserve"><code class="language-html">&lt;!doctype html&gt;
&lt;html lang="fr"&gt;
&lt;html lang="fr"&gt;
&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;title&gt;document écrit en français&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/head&gt;
&lt;body&gt;
... document écrit en français ...
&lt;/body&gt;
&lt;/html&gt;</code></pre>
Expand All @@ -49,7 +49,7 @@ <h3>Defining the content of an HTML document to be in French</h3>
<h2>Tests</h2>
<section class="procedure">
<h3>Procedure</h3>
<p>Examine the <code class="language-html">html</code> element of the document.</p>
<p>Examine the <code class="language-html">html</code> element of the document.</p>
<ol>
<li>Check that the <code class="language-html">html</code> element has a <code class="language-html">lang</code> attribute.</li>
<li>Check that the value of the <code class="language-html">lang</code> attribute conforms to <a href="https://www.rfc-editor.org/info/bcp47">BCP 47: Tags for Identifying Languages; Matching of Language Tags</a> or its successor and reflects the primary language used by the web page.</li>
Expand All @@ -69,7 +69,7 @@ <h2>Related Techniques</h2>
</ul>
</section>
<section id="resources">
<h2>Resources</h2>
<h2>Resources</h2>
<ul>
<li>
<a href="https://html.spec.whatwg.org/multipage/dom.html#the-lang-and-xml:lang-attributes">HTML - The <code class="language-html">lang</code> and <code class="language-html">xml:lang</code> attributes</a>.
Expand All @@ -83,7 +83,10 @@ <h2>Resources</h2>
<li>
<a href="https://www.w3.org/International/articles/language-tags/">Language tags in HTML and XML</a>.
</li>
</ul>
<li>
<a href="https://www.w3.org/International/questions/qa-html-language-declarations">Declaring language in HTML</a>
</li>
</ul>
</section>
</body>
</html>
33 changes: 18 additions & 15 deletions techniques/html/H58.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h2>When to Use</h2>
<section id="description">
<h2>Description</h2>
<p>The objective of this technique is to clearly identify any changes in language on a page by using the <code class="language-html">lang</code> attribute.</p>

<p>Allowed values for the <code class="language-html">lang</code> attribute are indicated in the resources referenced below. Language tags use a primary code to indicate the language, and optional sub-codes (separated by hyphen characters) to indicate variants of the language. For instance, English is indicated with the primary code <code class="language-html">"en"</code>; British English and American English can be distinguished by using <code class="language-html">"en-GB"</code> and <code class="language-html">"en-US"</code>, respectively. Use of the primary code is important for this technique. Use of sub-codes is optional but may be helpful in certain circumstances.</p>
</section>
<section id="examples">
Expand Down Expand Up @@ -69,20 +69,23 @@ <h2>Related Techniques</h2>
</section>
<section id="resources">
<h2>Resources</h2>
<ul>
<li>
<a href="https://html.spec.whatwg.org/multipage/dom.html#the-lang-and-xml:lang-attributes">HTML - The <code class="language-html">lang</code> and <code class="language-html">xml:lang</code> attributes</a>.
</li>
<li>
<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang">HTML "<code class="language-html">lang</code>" attribute on the Mozilla Developer Network</a>.
</li>
<li>
<a href="https://www.rfc-editor.org/info/bcp47">BCP 47: Tags for Identifying Languages; Matching of Language Tags</a>.
</li>
<li>
<a href="https://www.w3.org/International/articles/language-tags/">Language tags in HTML and XML</a>.
</li>
</ul>
<ul>
<li>
<a href="https://html.spec.whatwg.org/multipage/dom.html#the-lang-and-xml:lang-attributes">HTML - The <code class="language-html">lang</code> and <code class="language-html">xml:lang</code> attributes</a>.
</li>
<li>
<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang">HTML "<code class="language-html">lang</code>" attribute on the Mozilla Developer Network</a>.
</li>
<li>
<a href="https://www.rfc-editor.org/info/bcp47">BCP 47: Tags for Identifying Languages; Matching of Language Tags</a>.
</li>
<li>
<a href="https://www.w3.org/International/articles/language-tags/">Language tags in HTML and XML</a>.
</li>
<li>
<a href="https://www.w3.org/International/questions/qa-html-language-declarations">Declaring language in HTML</a>
</li>
</ul>
</section>
</body>
</html>
90 changes: 23 additions & 67 deletions understanding/20/language-of-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>
<body>
<h1>Understanding Language of Page</h1>

<section id="brief">
<h2>In brief</h2>
<dl>
Expand All @@ -17,11 +17,10 @@ <h2>In brief</h2>
</dl>

</section>

<section id="intent">
<h2>Intent of Language of Page</h2>



<p>
The intent of this success criterion is to ensure that content developers provide
information in the web page that user agents need to present text and other linguistic
Expand All @@ -30,142 +29,99 @@ <h2>Intent of Language of Page</h2>
can load the correct pronunciation rules. Visual browsers can display characters and
scripts correctly. Media players can show captions correctly. As a result, users with
disabilities will be better able to understand the content.

</p>

<p>The default human language of the web page is the default text-processing language
as discussed in
as discussed in
<a href="https://www.w3.org/International/techniques/authoring-html#gslang">Internationalization Best Practices: Specifying Language in XHTML &amp; HTML Content</a>. When a web page uses several languages, the default text-processing language is
the language which is used most. (If several languages are used equally, the first
language used should be chosen as the default human language.)

language used should be chosen as the default human language.)
</p>

<div class="note">

<p>
For multilingual sites targeting Conformance Level A, the Working Group strongly encourages
developers to follow Success Criterion 3.1.2 as well even though that is a Level AA
success criterion.


</p>

</div>


</section>
<section id="benefits">
<h2>Benefits of Language of Page</h2>



<p>This success criterion helps:</p>

<ul>

<li>people who use screen readers or other technologies that convert text into synthetic
speech;
</li>

<li>people who find it difficult to read written material with fluency and accuracy, such
as recognizing characters and alphabets or decoding words;
</li>

<li>people with certain cognitive, language and learning disabilities who use text-to-speech
software

</li>

<li>people who rely on captions for synchronized media.</li>

</ul>

</section>

<section id="examples">
<h2>Examples of Language of Page</h2>

<dl>
<dt>Example 1. A web page with content in two languages</dt>
<dd>A web page produced in Germany and written in HTML includes content in both German
and English, but most of the content is in German. The default human language is identified
as German (de) by the lang attribute on the html element.</dd>
</dl>

</section>

<section id="resources">
<h2>Resources for Language of Page</h2>



<ul>

<li>

<a href="https://www.w3.org/International/techniques/authoring-html#gslang">Internationalization Best Practices: Specifying Language in XHTML &amp; HTML Content</a>

</li>


<li>
<a href="https://www.w3.org/International/questions/qa-html-language-declarations">Declaring language in HTML</a>
</li>
</ul>

</section>

<section id="techniques">
<h2>Techniques for Language of Page</h2>



<section id="sufficient">
<h3>Sufficient Techniques for Language of Page</h3>



<ul>

<li>

<a href="../Techniques/html/H57" class="html">Using the lang attribute of the html element</a>

</li>

<li>

<a href="../Techniques/pdf/PDF16" class="pdf"></a>

</li>

<li>

<a href="../Techniques/pdf/PDF19" class="pdf"></a>

</li>

</ul>

</section>

<section id="advisory">
<h3>Additional Techniques (Advisory) for Language of Page</h3>



<ul>

<li>

<a href="../Techniques/server-side-script/SVR5" class="server">Specifying the default language in the HTTP header</a>

</li>

</ul>

</section>

<section id="failure">
<h3>Failures for Language of Page</h3>



</section>

</section>

</body>
</html>
Loading