Skip to content

Commit a481bea

Browse files
fstrrkfranqueiro
andauthored
Modified examples in Language of parts (#4240)
Adds content for case where the element's content and attribute values are in different languages Closes #4064 Add the requested example for “The element's content and attribute values are in different languages”. Also: 1. updated some old attributes that didn’t do anything 2. changed bolded `p` tags to `h3` elements --------- Co-authored-by: Kenneth G. Franqueiro <[email protected]>
1 parent 43b7ca3 commit a481bea

File tree

1 file changed

+19
-34
lines changed

1 file changed

+19
-34
lines changed

understanding/20/language-of-parts.html

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -127,51 +127,36 @@ <h2>Benefits of Language of Parts</h2>
127127

128128
<section id="examples">
129129
<h2>Examples of Language of Parts</h2>
130-
131-
<ul>
132-
<li>
133-
<p>
134-
<strong>A German phrase in an English sentence.</strong>
135-
</p>
136-
<p>In the sentence, "He maintained that the DDR (German Democratic Republic) was just
137-
a '<span lang="de">Treppenwitz der Weltgeschichte</span>'," the German phrase '<span lang="de">Treppenwitz der Weltgeschichte</span>' is marked as German. Depending on the markup language, English may either be marked
138-
as the language for the entire document except where specified, or marked at the paragraph
139-
level. When a screen reader encounters the German phrase, it changes pronunciation
140-
rules from English to German to pronounce the word correctly.
141-
</p>
142-
</li>
143-
<li>
144-
<p>
145-
<strong>Alternative language links</strong>
146-
</p>
147-
<p>An HTML web page includes links to versions of the page in other languages (e.g.,
148-
<span lang="de">Deutsch</span>, <span lang="fr">Français</span>, <span lang="nl">Nederlands</span>, <span lang="ca">Catalan</span>, etc.). The text of each link is the name of the language, in that language. The language of each link is indicated via a <code class="att">lang</code> attribute.
149-
</p>
150-
<pre xml:space="preserve"><code>&lt;ul&gt;
130+
131+
<h3>A German phrase in an English sentence</h3>
132+
<p>In the sentence, "He maintained that the DDR (German Democratic Republic) was just a '<span lang="de">Treppenwitz der Weltgeschichte</span>'," the German phrase '<span lang="de">Treppenwitz der Weltgeschichte</span>' is marked as German. Depending on the markup language, English may either be marked as the language for the entire document except where specified, or marked at the paragraph level. When a screen reader encounters the German phrase, it changes pronunciation rules from English to German to pronounce the word correctly.</p>
133+
134+
<h3>Alternative language links</h3>
135+
<p>An HTML web page includes links to versions of the page in other languages (e.g.,
136+
<span lang="de">Deutsch</span>, <span lang="fr">Français</span>, <span lang="nl">Nederlands</span>, <span lang="ca">Catalan</span>, etc.). The text of each link is the name of the language, in that language. The language of each link is indicated via a <code class="language-html">lang</code> attribute.</p>
137+
<pre xml:space="preserve"><code class="language-html">&lt;ul&gt;
151138
&lt;li&gt;&lt;a href="..." lang="de"&gt;Deutsch&lt;/a&gt;&lt;/li&gt;
152139
&lt;li&gt;&lt;a href="..." lang="it"&gt;Italiano&lt;/a&gt;&lt;/li&gt;
153140
&lt;li&gt;&lt;a href="..." lang="fr"&gt;Français&lt;/a&gt;&lt;/li&gt;
154141
...
155142
&lt;li&gt;&lt;a href="..." lang="zh-hant"&gt;繁體中文&lt;/a&gt;&lt;/li&gt;
156143
&lt;/ul&gt;</code></pre>
157-
</li>
158-
<li>
159-
<p>
160-
<strong>"Podcast" used in a French sentence.</strong>
161-
</p>
162-
<p>Because "podcast" is part of the vernacular of the immediately surrounding text in
163-
the following excerpt, "<span lang="fr">À l'occasion de l'exposition "Energie éternelle. 1500 ans d'art indien", le Palais des Beaux-Arts de Bruxelles a lancé son premier podcast. Vous pouvez télécharger ce podcast au format M4A et MP3</span>", no indication of language change is required.
164-
</p>
165-
</li>
166-
</ul>
144+
145+
<h3>"Podcast" used in a French sentence</h3>
146+
<p>Because "podcast" is part of the vernacular of the immediately surrounding text in the following excerpt, "<span lang="fr">À l'occasion de l'exposition "Energie éternelle. 1500 ans d'art indien", le Palais des Beaux-Arts de Bruxelles a lancé son premier podcast. Vous pouvez télécharger ce podcast au format M4A et MP3</span>", no indication of language change is required.</p>
147+
148+
<h3>The element's content and attribute values are in different languages</h3>
149+
<p>This example assumes that the page's default content is in English. The link's <code class="language-html">title</code> attribute is in English, but the nested <code class="language-html">span</code> element that contains the word <span lang="es">Español</span> has a <code>lang="es"</code> attribute.</p>
150+
151+
<p><code class="language-html">&lt;a title="Spanish" href="qa-html-language-declarations-es.html"&gt;&lt;span lang="es"&gt;Español&lt;/span&gt;&lt;/a&gt;</code></p>
167152
</section>
168153

169154
<section id="resources">
170155
<h2>Resources for Language of Parts</h2>
171156

172157
<ul>
173158
<li>
174-
<a href="https://html.spec.whatwg.org/multipage/dom.html#attr-lang">HTML - The <code class="att">lang</code> and <code class="att">xml:lang</code> attributes</a>.
159+
<a href="https://html.spec.whatwg.org/multipage/dom.html#attr-lang">HTML - The <code class="language-html">lang</code> and <code class="language-html">xml:lang</code> attributes</a>.
175160
</li>
176161
<li>
177162
<a href="https://www.w3.org/International/articles/language-tags/index.en">Language tags in HTML and XML</a>.
@@ -191,10 +176,10 @@ <h3>Sufficient Techniques for Language of Parts</h3>
191176

192177
<ul>
193178
<li>
194-
<a href="../Techniques/html/H58" class="html">Using the lang attribute to identify changes in the human language</a>.
179+
<a href="../Techniques/html/H58">Using the lang attribute to identify changes in the human language</a>.
195180
</li>
196181
<li>
197-
<a href="../Techniques/pdf/PDF19" class="pdf">Specifying the language for a passage or phrase with the Lang entry in PDF documents</a>.
182+
<a href="../Techniques/pdf/PDF19">Specifying the language for a passage or phrase with the Lang entry in PDF documents</a>.
198183
</li>
199184
</ul>
200185

0 commit comments

Comments
 (0)