[html5] r7745 - [t] (0) Clean up some translation-related things. Affected topics: DOM APIs, HTML

whatwg at whatwg.org whatwg at whatwg.org
Fri Mar 8 15:38:07 PST 2013


Author: ianh
Date: 2013-03-08 15:38:06 -0800 (Fri, 08 Mar 2013)
New Revision: 7745

Modified:
   complete.html
   index
   source
Log:
[t] (0) Clean up some translation-related things.
Affected topics: DOM APIs, HTML

Modified: complete.html
===================================================================
--- complete.html	2013-03-08 20:07:58 UTC (rev 7744)
+++ complete.html	2013-03-08 23:38:06 UTC (rev 7745)
@@ -9619,27 +9619,48 @@
   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><a href=#attr-translate>translate</a></code> 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>Each element (even non-HTML elements) 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 an <a href=#html-elements title="HTML elements">HTML element</a>'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, either the
+  element's <code title=attr-translate><a href=#attr-translate>translate</a></code> attribute is in the <i>inherit</i> state,
+  or the element is not an <a href=#html-elements title="HTML elements">HTML element</a> and thus does not have a
+  <code title=attr-translate><a href=#attr-translate>translate</a></code> attribute; in either case, the element's
+  <a href=#translation-mode>translation mode</a> is in the same state as its parent element's, 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=translate-enabled>translate-enabled</dfn> state, the element's <a href=#translatable-attributes>translatable
+  attributes</a> 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>
+  <p>The following attributes are <dfn id=translatable-attributes>translatable attributes</dfn>:</p>
 
+  <ul class=brief><li><code title=attr-th-abbr><a href=#attr-th-abbr>abbr</a></code> on <code><a href=#the-th-element>th</a></code> elements</li>
+   <li><code title="">alt</code> on <code title=attr-area-alt><a href=#attr-area-alt>area</a></code>,
+                                    <code title=attr-img-alt><a href=#attr-img-alt>img</a></code>, and
+                                    <code title=attr-input-alt><a href=#attr-input-alt>input</a></code> elements</li>
+   <li><code title=attr-meta-content><a href=#attr-meta-content>content</a></code> on <code><a href=#the-meta-element>meta</a></code> elements, if the <code title=attr-meta-name><a href=#attr-meta-name>name</a></code> attribute specifies a metadata name whose value is known to be translatable</li>
+   <li><code title="">download</code> on <code title=attr-a-download>a</code> and
+                                         <code title=attr-area-download>area</code> elements</li>
+   <li><code title="">label</code> on <code title=attr-menuitem-label><a href=#attr-menuitem-label>menuitem</a></code>,
+                                      <code title=attr-menu-label><a href=#attr-menu-label>menu</a></code>,
+                                      <code title=attr-optgroup-label><a href=#attr-optgroup-label>optgroup</a></code>,
+                                      <code title=attr-option-label><a href=#attr-option-label>option</a></code>, and
+                                      <code title=attr-track-label><a href=#attr-track-label>label</a></code> elements</li>
+   <li><code title=attr-lang><a href=#attr-lang>lang</a></code> on <a href=#html-elements>HTML elements</a>; must be "translated" to match the language used in the translation</li>
+   <li><code title="">placeholder</code> on <code title=attr-input-placeholder><a href=#attr-input-placeholder>input</a></code> and
+                                            <code title=attr-textarea-placeholder><a href=#attr-textarea-placeholder>textarea</a></code> elements</li>
+   <li><code title=attr-iframe-srcdoc><a href=#attr-iframe-srcdoc>srcdoc</a></code> on <code><a href=#the-iframe-element>iframe</a></code> elements; must be parsed and recursively processed</li>
+   <li><code title=attr-style><a href=#the-style-attribute>style</a></code> on <a href=#html-elements>HTML elements</a> elements; must be parsed and recursively processed (e.g. for the values of 'content' properties)</li>
+   <li><code title=attr-title><a href=#attr-title>title</a></code> on all <a href=#html-elements>HTML elements</a> elements</li>
+   <!-- <input value> is excluded since we can't predict if it interferes with server-side processing -->
+  </ul><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>
@@ -83038,7 +83059,7 @@
   equal to <var title="">value</var>, then it must have its value updated to <var title="">value</var>. If its previous value <em>is</em> equal to <var title="">value</var>, then
   the method must do nothing.</p>
 
-  <p>If it couldn't set the new value, the method must throw an <code><a href=#quotaexceedederror>QuotaExceededError</a></code>
+  <p>If it couldn't set the new value, the method must throw a <code><a href=#quotaexceedederror>QuotaExceededError</a></code>
   exception. (Setting could fail if, e.g., the user has disabled storage for the site, or if the
   quota has been exceeded.)</p>
 

Modified: index
===================================================================
--- index	2013-03-08 20:07:58 UTC (rev 7744)
+++ index	2013-03-08 23:38:06 UTC (rev 7745)
@@ -9619,27 +9619,48 @@
   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><a href=#attr-translate>translate</a></code> 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>Each element (even non-HTML elements) 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 an <a href=#html-elements title="HTML elements">HTML element</a>'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, either the
+  element's <code title=attr-translate><a href=#attr-translate>translate</a></code> attribute is in the <i>inherit</i> state,
+  or the element is not an <a href=#html-elements title="HTML elements">HTML element</a> and thus does not have a
+  <code title=attr-translate><a href=#attr-translate>translate</a></code> attribute; in either case, the element's
+  <a href=#translation-mode>translation mode</a> is in the same state as its parent element's, 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=translate-enabled>translate-enabled</dfn> state, the element's <a href=#translatable-attributes>translatable
+  attributes</a> 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>
+  <p>The following attributes are <dfn id=translatable-attributes>translatable attributes</dfn>:</p>
 
+  <ul class=brief><li><code title=attr-th-abbr><a href=#attr-th-abbr>abbr</a></code> on <code><a href=#the-th-element>th</a></code> elements</li>
+   <li><code title="">alt</code> on <code title=attr-area-alt><a href=#attr-area-alt>area</a></code>,
+                                    <code title=attr-img-alt><a href=#attr-img-alt>img</a></code>, and
+                                    <code title=attr-input-alt><a href=#attr-input-alt>input</a></code> elements</li>
+   <li><code title=attr-meta-content><a href=#attr-meta-content>content</a></code> on <code><a href=#the-meta-element>meta</a></code> elements, if the <code title=attr-meta-name><a href=#attr-meta-name>name</a></code> attribute specifies a metadata name whose value is known to be translatable</li>
+   <li><code title="">download</code> on <code title=attr-a-download>a</code> and
+                                         <code title=attr-area-download>area</code> elements</li>
+   <li><code title="">label</code> on <code title=attr-menuitem-label><a href=#attr-menuitem-label>menuitem</a></code>,
+                                      <code title=attr-menu-label><a href=#attr-menu-label>menu</a></code>,
+                                      <code title=attr-optgroup-label><a href=#attr-optgroup-label>optgroup</a></code>,
+                                      <code title=attr-option-label><a href=#attr-option-label>option</a></code>, and
+                                      <code title=attr-track-label><a href=#attr-track-label>label</a></code> elements</li>
+   <li><code title=attr-lang><a href=#attr-lang>lang</a></code> on <a href=#html-elements>HTML elements</a>; must be "translated" to match the language used in the translation</li>
+   <li><code title="">placeholder</code> on <code title=attr-input-placeholder><a href=#attr-input-placeholder>input</a></code> and
+                                            <code title=attr-textarea-placeholder><a href=#attr-textarea-placeholder>textarea</a></code> elements</li>
+   <li><code title=attr-iframe-srcdoc><a href=#attr-iframe-srcdoc>srcdoc</a></code> on <code><a href=#the-iframe-element>iframe</a></code> elements; must be parsed and recursively processed</li>
+   <li><code title=attr-style><a href=#the-style-attribute>style</a></code> on <a href=#html-elements>HTML elements</a> elements; must be parsed and recursively processed (e.g. for the values of 'content' properties)</li>
+   <li><code title=attr-title><a href=#attr-title>title</a></code> on all <a href=#html-elements>HTML elements</a> elements</li>
+   <!-- <input value> is excluded since we can't predict if it interferes with server-side processing -->
+  </ul><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>
@@ -83038,7 +83059,7 @@
   equal to <var title="">value</var>, then it must have its value updated to <var title="">value</var>. If its previous value <em>is</em> equal to <var title="">value</var>, then
   the method must do nothing.</p>
 
-  <p>If it couldn't set the new value, the method must throw an <code><a href=#quotaexceedederror>QuotaExceededError</a></code>
+  <p>If it couldn't set the new value, the method must throw a <code><a href=#quotaexceedederror>QuotaExceededError</a></code>
   exception. (Setting could fail if, e.g., the user has disabled storage for the site, or if the
   quota has been exceeded.)</p>
 

Modified: source
===================================================================
--- source	2013-03-08 20:07:58 UTC (rev 7744)
+++ source	2013-03-08 23:38:06 UTC (rev 7745)
@@ -9532,25 +9532,51 @@
   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>Each element (even non-HTML elements) has a <dfn>translation mode</dfn>, which is in either the
+  <span>translate-enabled</span> state or the <span>no-translate</span> state. If an <span
+  title="HTML elements">HTML element</span>'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, either the
+  element's <code title="attr-translate">translate</code> attribute is in the <i>inherit</i> state,
+  or the element is not an <span title="HTML elements">HTML element</span> and thus does not have a
+  <code title="attr-translate">translate</code> attribute; in either case, the element's
+  <span>translation mode</span> is in the same state as its parent element's, 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>translate-enabled</dfn> state, the element's <span>translatable
+  attributes</span> 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>
 
+  <p>The following attributes are <dfn>translatable attributes</dfn>:</p>
+
+  <ul class="brief">
+   <li><code title="attr-th-abbr">abbr</code> on <code>th</code> elements</li>
+   <li><code title="">alt</code> on <code title="attr-area-alt">area</code>,
+                                    <code title="attr-img-alt">img</code>, and
+                                    <code title="attr-input-alt">input</code> elements</li>
+   <li><code title="attr-meta-content">content</code> on <code>meta</code> elements, if the <code title="attr-meta-name">name</code> attribute specifies a metadata name whose value is known to be translatable</li>
+   <li><code title="">download</code> on <code title="attr-a-download">a</code> and
+                                         <code title="attr-area-download">area</code> elements</li>
+   <li><code title="">label</code> on <code title="attr-menuitem-label">menuitem</code>,
+                                      <code title="attr-menu-label">menu</code>,
+                                      <code title="attr-optgroup-label">optgroup</code>,
+                                      <code title="attr-option-label">option</code>, and
+                                      <code title="attr-track-label">label</code> elements</li>
+   <li><code title="attr-lang">lang</code> on <span>HTML elements</span>; must be "translated" to match the language used in the translation</li>
+   <li><code title="">placeholder</code> on <code title="attr-input-placeholder">input</code> and
+                                            <code title="attr-textarea-placeholder">textarea</code> elements</li>
+   <li><code title="attr-iframe-srcdoc">srcdoc</code> on <code>iframe</code> elements; must be parsed and recursively processed</li>
+   <li><code title="attr-style">style</code> on <span>HTML elements</span> elements; must be parsed and recursively processed (e.g. for the values of 'content' properties)</li>
+   <li><code title="attr-title">title</code> on all <span>HTML elements</span> elements</li>
+   <!-- <input value> is excluded since we can't predict if it interferes with server-side processing -->
+  </ul>
+
   <div class="impl">
 
   <hr>
@@ -95870,7 +95896,7 @@
   title="">value</var>. If its previous value <em>is</em> equal to <var title="">value</var>, then
   the method must do nothing.</p>
 
-  <p>If it couldn't set the new value, the method must throw an <code>QuotaExceededError</code>
+  <p>If it couldn't set the new value, the method must throw a <code>QuotaExceededError</code>
   exception. (Setting could fail if, e.g., the user has disabled storage for the site, or if the
   quota has been exceeded.)</p>
 




More information about the Commit-Watchers mailing list