Skip to content

Commit 81c97b4

Browse files
authored
Translate qa-html-dir into zh-hans (#734)
1 parent 91ce97a commit 81c97b4

File tree

5 files changed

+735
-10
lines changed

5 files changed

+735
-10
lines changed

questions/qa-html-dir-data/translations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var trans = { }
22

3-
trans.versions = ['en']
3+
trans.versions = ['en', 'zh-hans']
44

55
trans.outofdatetranslations = []
66

questions/qa-html-dir.en.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ <h1>Structural markup and right-to-left text in HTML</h1>
6767

6868
<p>This article looks at ways of handling text direction for <em>structural</em> markup in HTML, ie. at the document level and for elements like paragraphs, tables and forms.</p>
6969

70-
<p class="warning">For handling <a href="https://w3c.github.io/i18n-glossary/#def_bidirectional_text" class="termref print">bidirectional text</a> with <em>inline</em> markup you should read the separate article, <cite><a class="print" href="/International/articles/inline-bidi-markup/">Inline markup and bidirectional text in HTML</a></cite>. It also describes some other elements and attributes related to direction.</p>
70+
<p class="warning">For handling <a href="https://www.w3.org/TR/i18n-glossary/#dfn-bidirectional-text" class="termref print">bidirectional text</a> with <em>inline</em> markup you should read the separate article, <cite><a class="print" href="/International/articles/inline-bidi-markup/">Inline markup and bidirectional text in HTML</a></cite>. It also describes some other elements and attributes related to direction.</p>
7171

7272
<p>The <code class="kw" translate="no">dir</code> attribute is used to set the base direction of text for display. It is essential to support languages that use right-to-left scripts such as Adlam, Arabic, Hebrew, N'Ko, Syriac, and Thaana. Many different languages are written with these scripts, including Arabic, Dhivehi, Hebrew, Mandinka, Pashto, Persian, Pular, Sindhi, Syriac, Urdu, Yiddish, etc.</p>
7373
</div>
@@ -102,16 +102,16 @@ <h2>Setting direction at the document level</h2>
102102

103103

104104

105-
<section>
106-
<h3 id="basedirection">Base direction</h3>
105+
<section id="basedirection">
106+
<h3>Base direction</h3>
107107

108108
<div class="insideinfonote">
109109
<p class="info noprint">Examples in this document may be shown as images to avoid problems for those with a browser that doesn't produce what was intended. </p>
110110

111111
<p>Code samples containing Arabic and Hebrew text <a class="print" href="https://www.w3.org/TR/i18n-html-tech-bidi/#bidisource"> may be displayed in different ways</a>, none of which are usually satisfactory. In this article right-to-left text in code samples may be represented by UPPERCASE TRANSLATIONS, and left-to-right text by lowercase.</p>
112112
</div>
113113

114-
<p class="info">At the outset, it is important to understand the concept of <a href="https://w3c.github.io/i18n-glossary/#dfn-base-direction" target="_blank" class="termref print">base direction</a> (see <a href="../articles/inline-bidi-markup/uba-basics">Unicode Bidirectional Algorithm basics</a> for a simple overview of how it works with the <a href="https://w3c.github.io/i18n-glossary/#dfn-unicode-bidi-algorithm" target="_blank" class="termref print">Unicode bidirectional algorithm</a>). </p>
114+
<p class="info">At the outset, it is important to understand the concept of <a href="https://www.w3.org/TR/i18n-glossary/#dfn-base-direction" target="_blank" class="termref print">base direction</a> (see <a href="../articles/inline-bidi-markup/uba-basics">Unicode Bidirectional Algorithm basics</a> for a simple overview of how it works with the <a href="https://www.w3.org/TR/i18n-glossary/#dfn-unicode-bidi-algorithm" target="_blank" class="termref print">Unicode bidirectional algorithm</a>). </p>
115115

116116
<p>It is fundamentally important to establish the appropriate base direction for the text, so that the Unicode bidirectional algorithm can reorder the text appropriately when it is displayed. Correctly setting the base direction also sets the default paragraph alignment of the text.</p>
117117

@@ -170,7 +170,7 @@ <h3>Setting up a right-to-left page</h3>
170170
<section id="lang_tags">
171171
<h4>Language tags</h4>
172172

173-
<p>While you are declaring the directionality of the document in the <span class="kw">html</span> tag, don't forget to also declare the <em>language</em> of the document using the <span class="kw">lang</span> attribute (see <a class="print" href="/International/questions/qa-html-language-declarations">Declaring language in HTML</a>). However, do not make the mistake of assuming that language declarations indicate directionality, or vice versa! Even if the language declaration has a script tag it won't affect the directionality of the text in the user agent. You must always declare the directionality using the <span class="kw">dir</span> attribute.</p>
173+
<p>While you are declaring the directionality of the document in the <span class="kw">html</span> tag, don't forget to also declare the <em>language</em> of the document using the <span class="kw">lang</span> attribute (see <a class="print" href="/International/questions/qa-html-language-declarations">Declaring language in HTML</a>). However, do not make the mistake of assuming that language declarations indicate directionality, or vice versa! Even if the language declaration has a script subtag it won't affect the directionality of the text in the user agent. You must always declare the directionality using the <span class="kw">dir</span> attribute.</p>
174174
</section>
175175

176176

@@ -201,7 +201,7 @@ <h3>The <code class="kw" translate="no">title</code> element</h3>
201201

202202
<p>Much of the time this will produce the desired result. However, if the title text in a RTL document begins with, say, an acronym in the Latin script, the order will be incorrect when the text is displayed (<a class="print" href="https://www.w3.org/International/i18n-tests/results/native-user-interfaces#windowheader" target="_blank">see some tests</a>).</p>
203203

204-
<p>A workaround for this scenario is to add <code>&amp;rlm;</code> at the beginning of the title text when it doesn't begin with a RTL character. This adds <span class="codepoint" translate="no"><span class="uname">U+200F RIGHT-TO-LEFT MARK</span></span> at the start, which is an invisible, strongly directional RTL character.</p>
204+
<p>A workaround for this scenario is to add <code>&amp;rlm;</code> at the beginning of the title text when it doesn't begin with a RTL character. This adds <span class="codepoint" translate="no"><code class="uname">U+200F RIGHT-TO-LEFT MARK</code></span> at the start, which is an invisible, strongly directional RTL character.</p>
205205
<p>If you have a LTR text that begins with a strong RTL character, use <code>&amp;lrm;</code> at the start, instead.</p>
206206
</section>
207207
</section>
@@ -705,7 +705,7 @@ <h2>Further reading</h2>
705705
</li>
706706

707707
<li>
708-
<p>Related links, <cite>Authoring HTML &amp; CSS</cite></p>
708+
<p>Related links, <cite>Authoring web pages</cite></p>
709709
<ul>
710710
<li><a href="/International/techniques/authoring-html#direction">Text direction</a></li>
711711
<li><a href="/International/techniques/authoring-html#using">Setting up a right-to-left page</a></li>

0 commit comments

Comments
 (0)