Skip to content

Commit

Permalink
Translate qa-css-lang into zh-hans (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
xfq authored Aug 7, 2023
1 parent 5f720f1 commit af14e40
Show file tree
Hide file tree
Showing 4 changed files with 320 additions and 10 deletions.
2 changes: 1 addition & 1 deletion questions/qa-css-lang-data/translations.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var trans = { }

trans.versions = ['de','en'];
trans.versions = ['de','en','zh-hans'];

trans.outofdatetranslations = [];

Expand Down
2 changes: 1 addition & 1 deletion questions/qa-css-lang.de.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ <h3>Generische Klassen- oder ID-Selektoren</h3>
</figure>
</section>
<section id="xmllang">
<h3>Verwendung von CSS-Selektoren für XML mit <code class="kw" translate="no">xml:lang</code></h3>
<h2>Verwendung von CSS-Selektoren für XML mit <code class="kw" translate="no">xml:lang</code></h2>
<p> Wie schon erwähnt muss man in Dokumenten, die als XML verarbeitet werden, das <span class="kw">xml:lang</span>-Attribut anstelle des <span class="kw">lang</span>-Attributs zur Angabe der Sprache verwenden.</p>
<p><strong class="leadin">Verwendung von :lang</strong></p>
<p>Die Verwendung von <span class="kw">:lang</span> wirft keine Probleme auf. Wenn das Dokument als HTML verarbeitet wird, sucht der <span class="kw">:lang</span>-Selektor nach Werten von <span class="kw">lang</span>-Attributen. Wird das Dokument hingegen als XML verarbeitet, sucht der <span class="kw">:lang</span>-Selektor nach Werten von <span class="kw">xml:lang</span>-Attributen und ignoriert alle Werte von <span class="kw">lang</span>-Attributen.</p>
Expand Down
16 changes: 8 additions & 8 deletions questions/qa-css-lang.en.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h3>The <code>[lang="..."]</code> selector </h3>
<p>Use this selector to style an element where the <code class="kw" translate="no">lang</code> value exactly matches that in the selector.</p>
<p>The following CSS:</p>
<figure class="example">
<pre style="white-space:pre-wrap;"><code class="language-css">*[lang="zh"] {font-family: Kaiti,Kai, serif;}
<pre style="white-space:pre-wrap;"><code class="language-css">*[lang="zh"] {font-family: Kaiti, Kai, serif;}
</code></pre>
</figure>
<p>Will style the <code class="kw" translate="no">span</code> element below:</p>
Expand All @@ -110,7 +110,7 @@ <h3>The <code>[lang|="..."]</code> selector </h3>
<p>Use this selector to style an element where the <code class="kw" translate="no">lang</code> value starts with the value in the selector.</p>
<p>The following CSS:</p>
<figure class="example">
<pre style="white-space:pre-wrap;"><code class="language-css">*[lang|="zh"] {font-family: Kaiti,Kai, serif;}
<pre style="white-space:pre-wrap;"><code class="language-css">*[lang|="zh"] {font-family: Kaiti, Kai, serif;}
</code></pre>
</figure>
<p>Will style the <code class="kw" translate="no">span</code> element below:</p>
Expand Down Expand Up @@ -154,7 +154,7 @@ <h3>Inheritance of language values</h3>
<h3>Which language attribute? </h3>
<p>The <code class="kw" translate="no">lang</code> attribute is used to identify the language of text served as HTML. Text served as XML should use the <code class="kw" translate="no">xml:lang</code> attribute. </p>
<p>For XHTML that is served as text/html, it is recommended that you use both attributes, since the HTML parser will pick up on the <code class="kw" translate="no">lang</code> attribute, whereas if you parse the content as XML the <code class="kw" translate="no">xml:lang</code> attribute will be used by your XML parser.</p>
<p>The article will first discuss the various options for styling by language in HTML, using the lang attribute. There then follows a section about <a href="#xmllang">how to style XML documents</a> based on <code class="kw" translate="no">xml:lang</code>.</p>
<p>The article will first discuss the various options for styling by language in HTML, using the <code class="kw" translate="no">lang</code> attribute. There then follows a section about <a href="#xmllang">how to style XML documents</a> based on <code class="kw" translate="no">xml:lang</code>.</p>
</section>
<section id="colon-lang">
<h3>The <code>:lang(...)</code> pseudo-class selector</h3>
Expand Down Expand Up @@ -210,7 +210,7 @@ <h3>A <code>[lang|="..."]</code> selector that matches the beginning of a value
<section id="generic">
<h3>Generic class or id selectors</h3>
<p>This method avoids the need to match the language declarations at all, and relies on <code class="kw" translate="no">class</code> or <code class="kw" translate="no">id</code> attribute markup. Using an ordinary CSS class or id selector works with most browsers that support CSS. The disadvantage is that adding the attributes takes up time and bandwidth.</p>
<p>For the markup example above, this would require us to change the HTML code by adding class attributes as follows:</p>
<p>For the markup example above, this would require us to change the HTML code by adding <code class="kw" translate="no">class</code> attributes as follows:</p>
<figure class="example">
<pre style="white-space:pre-wrap;"><code class="language-html">
&lt;p&gt;It is polite to welcome people in their own language:&lt;/p&gt;
Expand All @@ -229,14 +229,14 @@ <h3>Generic class or id selectors</h3>
<pre style="white-space:pre-wrap;"><code class="language-css">body {font-family: "Times New Roman",serif; }
.ar {font-family: "Scheherazade",serif;
font-size: 120%;}
.zht {font-family: PMingLiU, MingLiU,serif;}
.zhs {font-family: SimSum-18030, SimHei,serif;}
.zht {font-family: Kai,KaiTi,serif;}
.zhs {font-family: DFKai-SB,BiauKai,serif;}
.din {font-family: "Doulos SIL",serif;}
</code></pre>
</figure>
</section>
<section id="xmllang">
<h3>Using CSS selectors in XML with <code class="kw" translate="no">xml:lang</code></h3>
<h2>Using CSS selectors in XML with <code class="kw" translate="no">xml:lang</code></h2>
<p>As mentioned earlier, in a document that is parsed as XML you need to use the <code class="kw" translate="no">xml:lang</code> attribute (rather than the <code class="kw" translate="no">lang</code> attribute) to express language information.</p>
<p><strong class="leadin">Using :lang</strong></p>
<p>Use of <code class="kw" translate="no">:lang</code> is straightforward. If the document is parsed as HTML, the <code class="kw" translate="no">:lang</code> selector will match content where the language was defined using a <code class="kw" translate="no">lang</code> attribute value. However, if the document is parsed as XML, the <code class="kw" translate="no">:lang</code> selector will match content labeled with an <code class="kw" translate="no">xml:lang</code> attribute value and ignore any <code class="kw" translate="no">lang</code> attribute value.</p>
Expand Down Expand Up @@ -291,7 +291,7 @@ <h2>Further reading</h2>
<p><a href="/International/articles/language-tags/"><cite>Language tags in HTML and XML</cite></a></p>
</li>
<li>
<p>Related links, <cite>Authoring HTML &amp; CSS</cite></p>
<p>Related links, <cite>Authoring web pages</cite></p>
<ul>
<li><a href="/International/techniques/authoring-html#style">Styling &amp; layout</a></li>
<li><a href="/International/techniques/authoring-html#langstyle">Styling by language</a></li>
Expand Down
Loading

0 comments on commit af14e40

Please sign in to comment.