Browse files

[t] (0) Clean up some translation-related things.

Affected topics: DOM APIs, HTML

git-svn-id: http://svn.whatwg.org/webapps@7745 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent db435fa commit ea7fe88dc645b4ffc92e40a8a8a995e910fa082b @Hixie Hixie committed Mar 8, 2013
Showing with 115 additions and 47 deletions.
  1. +37 −16 complete.html
  2. +37 −16 index
  3. +41 −15 source
View
53 complete.html
@@ -9619,26 +9619,47 @@ <h5 id=the-translate-attribute><span class=secno>3.2.3.4 </span>The <code title=
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>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>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 <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
@@ -83038,7 +83059,7 @@ <h4 id=the-storage-interface><span class=secno>11.2.1 </span>The <code><a href=#
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>
View
53 index
@@ -9619,26 +9619,47 @@ Transport Protocol"&gt;HTTP&lt;/abbr&gt; today.&lt;/p&gt;</pre> <!-- DO NOT REWR
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>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>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 <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
@@ -83038,7 +83059,7 @@ callback <dfn id=portcollectioncallback>PortCollectionCallback</dfn> = void (<a
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>
View
56 source
@@ -9532,25 +9532,51 @@ Transport Protocol">HTTP&lt;/abbr> today.&lt;/p></pre> <!-- DO NOT REWRAP THIS L
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>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 <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 @@ callback <dfn>PortCollectionCallback</dfn> = void (<span>MessagePort</span> port
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>

0 comments on commit ea7fe88

Please sign in to comment.