[html5] r6971 - [act] (0) Introduce a new global attribute for localisers to tell whether or not [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Feb 6 16:22:54 PST 2012


Author: ianh
Date: 2012-02-06 16:22:53 -0800 (Mon, 06 Feb 2012)
New Revision: 6971

Modified:
   complete.html
   index
   source
Log:
[act] (0) Introduce a new global attribute for localisers to tell whether or not content should be translated.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=12417
Affected topics: DOM APIs, HTML

Modified: complete.html
===================================================================
--- complete.html	2012-02-06 23:53:25 UTC (rev 6970)
+++ complete.html	2012-02-07 00:22:53 UTC (rev 6971)
@@ -240,7 +240,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 6 February 2012</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 7 February 2012</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -397,12 +397,13 @@
        <li><a href=#the-id-attribute><span class=secno>3.2.3.1 </span>The <code>id</code> attribute</a></li>
        <li><a href=#the-title-attribute><span class=secno>3.2.3.2 </span>The <code>title</code> attribute</a></li>
        <li><a href=#the-lang-and-xml:lang-attributes><span class=secno>3.2.3.3 </span>The <code title=attr-lang>lang</code> and <code title=attr-xml-lang>xml:lang</code> attributes</a></li>
-       <li><a href=#the-xml:base-attribute-(xml-only)><span class=secno>3.2.3.4 </span>The <code>xml:base</code>
+       <li><a href=#the-translate-attribute><span class=secno>3.2.3.4 </span>The <code title=attr-translate>translate</code> attribute</a></li>
+       <li><a href=#the-xml:base-attribute-(xml-only)><span class=secno>3.2.3.5 </span>The <code>xml:base</code>
   attribute (XML only)</a></li>
-       <li><a href=#the-dir-attribute><span class=secno>3.2.3.5 </span>The <code>dir</code> attribute</a></li>
-       <li><a href=#classes><span class=secno>3.2.3.6 </span>The <code>class</code> attribute</a></li>
-       <li><a href=#the-style-attribute><span class=secno>3.2.3.7 </span>The <code>style</code> attribute</a></li>
-       <li><a href=#embedding-custom-non-visible-data-with-the-data-*-attributes><span class=secno>3.2.3.8 </span>Embedding custom non-visible data with the <code title=attr-data-*>data-*</code> attributes</a></ol></li>
+       <li><a href=#the-dir-attribute><span class=secno>3.2.3.6 </span>The <code>dir</code> attribute</a></li>
+       <li><a href=#classes><span class=secno>3.2.3.7 </span>The <code>class</code> attribute</a></li>
+       <li><a href=#the-style-attribute><span class=secno>3.2.3.8 </span>The <code>style</code> attribute</a></li>
+       <li><a href=#embedding-custom-non-visible-data-with-the-data-*-attributes><span class=secno>3.2.3.9 </span>Embedding custom non-visible data with the <code title=attr-data-*>data-*</code> attributes</a></ol></li>
      <li><a href=#element-definitions><span class=secno>3.2.4 </span>Element definitions</a>
       <ol>
        <li><a href=#attributes><span class=secno>3.2.4.1 </span>Attributes</a></ol></li>
@@ -10833,6 +10834,7 @@
   // <span>metadata attributes</span>
            attribute DOMString <a href=#dom-title title=dom-title>title</a>;
            attribute DOMString <a href=#dom-lang title=dom-lang>lang</a>;
+           attribute boolean <a href=#dom-translate title=dom-translate>translate</a>;
            attribute DOMString <a href=#dom-dir title=dom-dir>dir</a>;
            attribute <span>DOMString</span> <a href=#dom-classname title=dom-className>className</a>;
   readonly attribute <a href=#domtokenlist>DOMTokenList</a> <a href=#dom-classlist title=dom-classList>classList</a>;
@@ -10974,6 +10976,7 @@
    <li><code title=attr-style><a href=#the-style-attribute>style</a></code></li>
    <li><code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code></li>
    <li><code title=attr-title><a href=#the-title-attribute>title</a></code></li>
+   <li><code title=attr-translate><a href=#attr-translate>translate</a></code></li>
   </ul><div class=impl>
 
   <p>These attributes are only defined by this specification as
@@ -11303,7 +11306,81 @@
 
 
 
-  <h5 id=the-xml:base-attribute-(xml-only)><span class=secno>3.2.3.4 </span>The <dfn title=attr-xml-base><code>xml:base</code></dfn>
+  <h5 id=the-translate-attribute><span class=secno>3.2.3.4 </span>The <code title=attr-translate><a href=#attr-translate>translate</a></code> attribute</h5>
+
+  <p>The <dfn id=attr-translate title=attr-translate><code>translate</code></dfn>
+  attribute is an <a href=#enumerated-attribute>enumerated attribute</a> that is used to
+  specify whether an element's attribute values and the values of its
+  <code><a href=#text>Text</a></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 id=translation-mode>translation mode</dfn>, which is in
+  either the <a href=#translate-enabled>translate-enabled</a> state or the
+  <a href=#no-translate>no-translate</a> state. If the element's <code title=attr-translate><a href=#attr-translate>translate</a></code> attribute is in the
+  <i>yes</i> state, then the element's <a href=#translation-mode>translation mode</a>
+  is in the <a href=#translate-enabled>translate-enabled</a> state. Otherwise, if the
+  element's <code title=attr-translate><a href=#attr-translate>translate</a></code> attribute is
+  in the <i>no</i> state, then the element's <a href=#translation-mode>translation
+  mode</a> is in the <a href=#no-translate>no-translate</a> state. Otherwise,
+  the element's code title="attr-translate">translate attribute
+  is in the <i>inherit</i> state; in that case, the element's
+  <a href=#translation-mode>translation mode</a> is in the same state as its parent
+  element, if any, or in the <a href=#translate-enabled>translate-enabled</a> state, if
+  the element is a <a href=#root-element>root element</a>.</p>
+
+  <p>When an element is in the <dfn id=translate-enabled>translate-enabled</dfn> state, the
+  element's attribute values and the values of its <code><a href=#text>Text</a></code>
+  node children are to be translated when the page is localized.</p>
+
+  <p>When an element is in the <dfn id=no-translate>no-translate</dfn> state, the
+  element's attribute values and the values of its <code><a href=#text>Text</a></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 id=dom-translate title=dom-translate><code>translate</code></dfn> IDL
+  attribute must, on getting, return true if the element's
+  <a href=#translation-mode>translation mode</a> is <a href=#translate-enabled>translate-enabled</a>, 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 id=the-xml:base-attribute-(xml-only)><span class=secno>3.2.3.5 </span>The <dfn title=attr-xml-base><code>xml:base</code></dfn>
   attribute (XML only)</h5>
 
   <p>The <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attribute is
@@ -11315,7 +11392,7 @@
   <a href=#html-documents>HTML documents</a>.</p>
 
 
-  <h5 id=the-dir-attribute><span class=secno>3.2.3.5 </span>The <dfn title=attr-dir><code>dir</code></dfn> attribute</h5>
+  <h5 id=the-dir-attribute><span class=secno>3.2.3.6 </span>The <dfn title=attr-dir><code>dir</code></dfn> attribute</h5>
 
   <p>The <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> attribute specifies the
   element's text directionality. The attribute is an <a href=#enumerated-attribute>enumerated
@@ -11529,7 +11606,7 @@
 
 
 
-  <h5 id=classes><span class=secno>3.2.3.6 </span>The <dfn title=attr-class><code>class</code></dfn> attribute</h5>
+  <h5 id=classes><span class=secno>3.2.3.7 </span>The <dfn title=attr-class><code>class</code></dfn> attribute</h5>
 
   <p>Every <a href=#html-elements title="HTML elements">HTML element</a> may have a
   <code title=attr-class><a href=#classes>class</a></code> attribute specified.</p>
@@ -11568,7 +11645,7 @@
 
 
 
-  <h5 id=the-style-attribute><span class=secno>3.2.3.7 </span>The <dfn title=attr-style><code>style</code></dfn> attribute</h5>
+  <h5 id=the-style-attribute><span class=secno>3.2.3.8 </span>The <dfn title=attr-style><code>style</code></dfn> attribute</h5>
 
   <p>All <a href=#html-elements>HTML elements</a> may have the <code title=attr-style><a href=#the-style-attribute>style</a></code> content attribute set. This is a
   <span>CSS styling attribute</span> as defined by the CSS Styling
@@ -11624,7 +11701,7 @@
 
 
 
-  <h5 id=embedding-custom-non-visible-data-with-the-data-*-attributes><span class=secno>3.2.3.8 </span><dfn>Embedding custom non-visible data</dfn> with the <code title=attr-data-*><a href=#attr-data-*>data-*</a></code> attributes</h5>
+  <h5 id=embedding-custom-non-visible-data-with-the-data-*-attributes><span class=secno>3.2.3.9 </span><dfn>Embedding custom non-visible data</dfn> with the <code title=attr-data-*><a href=#attr-data-*>data-*</a></code> attributes</h5>
 
   <p>A <dfn id=custom-data-attribute>custom data attribute</dfn> is an attribute in no
   namespace whose name starts with the string "<dfn id=attr-data-* title=attr-data-*><code>data-</code></dfn>", has at least one
@@ -96578,6 +96655,10 @@
           <code title=attr-style-title><a href=#attr-style-title>style</a></code>
      <td> Alternative style sheet set name
      <td> <a href=#attribute-text>Text</a>
+    <tr><th> <code title="">translate</code>
+     <td> <a href=#attr-translate title=attr-translate>HTML elements</a>
+     <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 href=#attr-hyperlink-type>a</a></code>;
           <code title=attr-hyperlink-type><a href=#attr-hyperlink-type>area</a></code>;

Modified: index
===================================================================
--- index	2012-02-06 23:53:25 UTC (rev 6970)
+++ index	2012-02-07 00:22:53 UTC (rev 6971)
@@ -240,7 +240,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 6 February 2012</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 7 February 2012</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -397,12 +397,13 @@
        <li><a href=#the-id-attribute><span class=secno>3.2.3.1 </span>The <code>id</code> attribute</a></li>
        <li><a href=#the-title-attribute><span class=secno>3.2.3.2 </span>The <code>title</code> attribute</a></li>
        <li><a href=#the-lang-and-xml:lang-attributes><span class=secno>3.2.3.3 </span>The <code title=attr-lang>lang</code> and <code title=attr-xml-lang>xml:lang</code> attributes</a></li>
-       <li><a href=#the-xml:base-attribute-(xml-only)><span class=secno>3.2.3.4 </span>The <code>xml:base</code>
+       <li><a href=#the-translate-attribute><span class=secno>3.2.3.4 </span>The <code title=attr-translate>translate</code> attribute</a></li>
+       <li><a href=#the-xml:base-attribute-(xml-only)><span class=secno>3.2.3.5 </span>The <code>xml:base</code>
   attribute (XML only)</a></li>
-       <li><a href=#the-dir-attribute><span class=secno>3.2.3.5 </span>The <code>dir</code> attribute</a></li>
-       <li><a href=#classes><span class=secno>3.2.3.6 </span>The <code>class</code> attribute</a></li>
-       <li><a href=#the-style-attribute><span class=secno>3.2.3.7 </span>The <code>style</code> attribute</a></li>
-       <li><a href=#embedding-custom-non-visible-data-with-the-data-*-attributes><span class=secno>3.2.3.8 </span>Embedding custom non-visible data with the <code title=attr-data-*>data-*</code> attributes</a></ol></li>
+       <li><a href=#the-dir-attribute><span class=secno>3.2.3.6 </span>The <code>dir</code> attribute</a></li>
+       <li><a href=#classes><span class=secno>3.2.3.7 </span>The <code>class</code> attribute</a></li>
+       <li><a href=#the-style-attribute><span class=secno>3.2.3.8 </span>The <code>style</code> attribute</a></li>
+       <li><a href=#embedding-custom-non-visible-data-with-the-data-*-attributes><span class=secno>3.2.3.9 </span>Embedding custom non-visible data with the <code title=attr-data-*>data-*</code> attributes</a></ol></li>
      <li><a href=#element-definitions><span class=secno>3.2.4 </span>Element definitions</a>
       <ol>
        <li><a href=#attributes><span class=secno>3.2.4.1 </span>Attributes</a></ol></li>
@@ -10833,6 +10834,7 @@
   // <span>metadata attributes</span>
            attribute DOMString <a href=#dom-title title=dom-title>title</a>;
            attribute DOMString <a href=#dom-lang title=dom-lang>lang</a>;
+           attribute boolean <a href=#dom-translate title=dom-translate>translate</a>;
            attribute DOMString <a href=#dom-dir title=dom-dir>dir</a>;
            attribute <span>DOMString</span> <a href=#dom-classname title=dom-className>className</a>;
   readonly attribute <a href=#domtokenlist>DOMTokenList</a> <a href=#dom-classlist title=dom-classList>classList</a>;
@@ -10974,6 +10976,7 @@
    <li><code title=attr-style><a href=#the-style-attribute>style</a></code></li>
    <li><code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code></li>
    <li><code title=attr-title><a href=#the-title-attribute>title</a></code></li>
+   <li><code title=attr-translate><a href=#attr-translate>translate</a></code></li>
   </ul><div class=impl>
 
   <p>These attributes are only defined by this specification as
@@ -11303,7 +11306,81 @@
 
 
 
-  <h5 id=the-xml:base-attribute-(xml-only)><span class=secno>3.2.3.4 </span>The <dfn title=attr-xml-base><code>xml:base</code></dfn>
+  <h5 id=the-translate-attribute><span class=secno>3.2.3.4 </span>The <code title=attr-translate><a href=#attr-translate>translate</a></code> attribute</h5>
+
+  <p>The <dfn id=attr-translate title=attr-translate><code>translate</code></dfn>
+  attribute is an <a href=#enumerated-attribute>enumerated attribute</a> that is used to
+  specify whether an element's attribute values and the values of its
+  <code><a href=#text>Text</a></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 id=translation-mode>translation mode</dfn>, which is in
+  either the <a href=#translate-enabled>translate-enabled</a> state or the
+  <a href=#no-translate>no-translate</a> state. If the element's <code title=attr-translate><a href=#attr-translate>translate</a></code> attribute is in the
+  <i>yes</i> state, then the element's <a href=#translation-mode>translation mode</a>
+  is in the <a href=#translate-enabled>translate-enabled</a> state. Otherwise, if the
+  element's <code title=attr-translate><a href=#attr-translate>translate</a></code> attribute is
+  in the <i>no</i> state, then the element's <a href=#translation-mode>translation
+  mode</a> is in the <a href=#no-translate>no-translate</a> state. Otherwise,
+  the element's code title="attr-translate">translate attribute
+  is in the <i>inherit</i> state; in that case, the element's
+  <a href=#translation-mode>translation mode</a> is in the same state as its parent
+  element, if any, or in the <a href=#translate-enabled>translate-enabled</a> state, if
+  the element is a <a href=#root-element>root element</a>.</p>
+
+  <p>When an element is in the <dfn id=translate-enabled>translate-enabled</dfn> state, the
+  element's attribute values and the values of its <code><a href=#text>Text</a></code>
+  node children are to be translated when the page is localized.</p>
+
+  <p>When an element is in the <dfn id=no-translate>no-translate</dfn> state, the
+  element's attribute values and the values of its <code><a href=#text>Text</a></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 id=dom-translate title=dom-translate><code>translate</code></dfn> IDL
+  attribute must, on getting, return true if the element's
+  <a href=#translation-mode>translation mode</a> is <a href=#translate-enabled>translate-enabled</a>, 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 id=the-xml:base-attribute-(xml-only)><span class=secno>3.2.3.5 </span>The <dfn title=attr-xml-base><code>xml:base</code></dfn>
   attribute (XML only)</h5>
 
   <p>The <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attribute is
@@ -11315,7 +11392,7 @@
   <a href=#html-documents>HTML documents</a>.</p>
 
 
-  <h5 id=the-dir-attribute><span class=secno>3.2.3.5 </span>The <dfn title=attr-dir><code>dir</code></dfn> attribute</h5>
+  <h5 id=the-dir-attribute><span class=secno>3.2.3.6 </span>The <dfn title=attr-dir><code>dir</code></dfn> attribute</h5>
 
   <p>The <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> attribute specifies the
   element's text directionality. The attribute is an <a href=#enumerated-attribute>enumerated
@@ -11529,7 +11606,7 @@
 
 
 
-  <h5 id=classes><span class=secno>3.2.3.6 </span>The <dfn title=attr-class><code>class</code></dfn> attribute</h5>
+  <h5 id=classes><span class=secno>3.2.3.7 </span>The <dfn title=attr-class><code>class</code></dfn> attribute</h5>
 
   <p>Every <a href=#html-elements title="HTML elements">HTML element</a> may have a
   <code title=attr-class><a href=#classes>class</a></code> attribute specified.</p>
@@ -11568,7 +11645,7 @@
 
 
 
-  <h5 id=the-style-attribute><span class=secno>3.2.3.7 </span>The <dfn title=attr-style><code>style</code></dfn> attribute</h5>
+  <h5 id=the-style-attribute><span class=secno>3.2.3.8 </span>The <dfn title=attr-style><code>style</code></dfn> attribute</h5>
 
   <p>All <a href=#html-elements>HTML elements</a> may have the <code title=attr-style><a href=#the-style-attribute>style</a></code> content attribute set. This is a
   <span>CSS styling attribute</span> as defined by the CSS Styling
@@ -11624,7 +11701,7 @@
 
 
 
-  <h5 id=embedding-custom-non-visible-data-with-the-data-*-attributes><span class=secno>3.2.3.8 </span><dfn>Embedding custom non-visible data</dfn> with the <code title=attr-data-*><a href=#attr-data-*>data-*</a></code> attributes</h5>
+  <h5 id=embedding-custom-non-visible-data-with-the-data-*-attributes><span class=secno>3.2.3.9 </span><dfn>Embedding custom non-visible data</dfn> with the <code title=attr-data-*><a href=#attr-data-*>data-*</a></code> attributes</h5>
 
   <p>A <dfn id=custom-data-attribute>custom data attribute</dfn> is an attribute in no
   namespace whose name starts with the string "<dfn id=attr-data-* title=attr-data-*><code>data-</code></dfn>", has at least one
@@ -96578,6 +96655,10 @@
           <code title=attr-style-title><a href=#attr-style-title>style</a></code>
      <td> Alternative style sheet set name
      <td> <a href=#attribute-text>Text</a>
+    <tr><th> <code title="">translate</code>
+     <td> <a href=#attr-translate title=attr-translate>HTML elements</a>
+     <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 href=#attr-hyperlink-type>a</a></code>;
           <code title=attr-hyperlink-type><a href=#attr-hyperlink-type>area</a></code>;

Modified: source
===================================================================
--- source	2012-02-06 23:53:25 UTC (rev 6970)
+++ source	2012-02-07 00:22:53 UTC (rev 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>;




More information about the Commit-Watchers mailing list