Short URL: http://html5.org/r/6971
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 6971 | 12417 | 2012-02-07 00:22 |
Index: source
===================================================================
--- source (revision 6970)
+++ source (revision 6971)
@@ -11199,6 +11199,7 @@
// <span>metadata attributes</span>
attribute DOMString <span title="dom-title">title</span>;
attribute DOMString <span title="dom-lang">lang</span>;
+ attribute boolean <span title="dom-translate">translate</span>;
attribute DOMString <span title="dom-dir">dir</span>;
attribute <span>DOMString</span> <span title="dom-className">className</span>;
readonly attribute <span>DOMTokenList</span> <span title="dom-classList">classList</span>;
@@ -11341,6 +11342,7 @@
<li><code title="attr-style">style</code></li>
<li><code title="attr-tabindex">tabindex</code></li>
<li><code title="attr-title">title</code></li>
+ <li><code title="attr-translate">translate</code></li>
</ul>
<div class="impl">
@@ -11718,6 +11720,84 @@
+ <h5>The <code title="attr-translate">translate</code> attribute</h5>
+
+ <p>The <dfn title="attr-translate"><code>translate</code></dfn>
+ attribute is an <span>enumerated attribute</span> that is used to
+ specify whether an element's attribute values and the values of its
+ <code>Text</code> node children are to be translated when the page
+ is localized, or whether to leave them unchanged.</p>
+
+ <p>The attribute's keywords are the empty string, <code
+ title="">yes</code>, and <code title="">no</code>. The empty string
+ and the <code title="">yes</code> keyword map to the <i>yes</i>
+ state. The <code title="">no</code> keyword maps to the <i>no</i>
+ state. In addition, there is a third state, the <i>inherit</i>
+ state, which is the <i>missing value default</i> (and the <i>invalid
+ value default</i>).</p>
+
+ <p>Each element has a <dfn>translation mode</dfn>, which is in
+ either the <span>translate-enabled</span> state or the
+ <span>no-translate</span> state. If the element's <code
+ title="attr-translate">translate</code> attribute is in the
+ <i>yes</i> state, then the element's <span>translation mode</span>
+ is in the <span>translate-enabled</span> state. Otherwise, if the
+ element's <code title="attr-translate">translate</code> attribute is
+ in the <i>no</i> state, then the element's <span>translation
+ mode</span> is in the <span>no-translate</span> state. Otherwise,
+ the element's code title="attr-translate">translate</code> attribute
+ is in the <i>inherit</i> state; in that case, the element's
+ <span>translation mode</span> is in the same state as its parent
+ element, if any, or in the <span>translate-enabled</span> state, if
+ the element is a <span>root element</span>.</p>
+
+ <p>When an element is in the <dfn>translate-enabled</dfn> state, the
+ element's attribute values and the values of its <code>Text</code>
+ node children are to be translated when the page is localized.</p>
+
+ <p>When an element is in the <dfn>no-translate</dfn> state, the
+ element's attribute values and the values of its <code>Text</code>
+ node children are to be left as-is when the page is localized, e.g.
+ because the element contains a person's name or a the name of a
+ computer program.</p>
+
+ <div class="impl">
+
+ <hr>
+
+ <p>The <dfn title="dom-translate"><code>translate</code></dfn> IDL
+ attribute must, on getting, return true if the element's
+ <span>translation mode</span> is <span>translate-enabled</span>, and
+ false otherwise. On setting, it must set the content attribute's
+ value to "<code title="">yes</code>" if the new value is true, and
+ set the content attribute's value to "<code title="">no</code>
+ otherwise.</p>
+
+ </div>
+
+ <div class="example">
+
+ <p>In this example, everything in the document is to be translated
+ when the page is localised, except the sample keyboard input and
+ sample program output:</p>
+
+ <pre><!DOCTYPE HTML>
+<html> <!-- default on the root element is translate=yes -->
+ <head>
+ <title>The Bee Game</title> <!-- implied translate=yes inherited from ancestors -->
+ </head>
+ <body>
+ <p>The Bee Game is a text adventure game in English.</p>
+ <p>When the game launches, the first thing you should do is type
+ <kbd <strong>translate=no</strong>>eat honey</kbd>. The game will respond with:</p>
+ <pre><samp <strong>translate=no</strong>>Yum yum! That was some good honey!</samp></pre>
+ </body>
+</html></pre>
+
+ </div>
+
+
+
<h5>The <dfn title="attr-xml-base"><code>xml:base</code></dfn>
attribute (XML only)</h5>
@@ -112847,6 +112927,11 @@
<td> Alternative style sheet set name
<td> <a href="#attribute-text">Text</a>
<tr>
+ <th> <code title="">translate</code>
+ <td> <span title="attr-translate">HTML elements</span>
+ <td> Whether the element is to be translated when the page is localized
+ <td> "<code title="">yes</code>"; "<code title="">no</code>"
+ <tr>
<th> <code title="">type</code>
<td> <code title="attr-hyperlink-type">a</code>;
<code title="attr-hyperlink-type">area</code>;