Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 720897 of translate

  • Revision slug: Web/HTML/Global_attributes/translate
  • Revision title: translate
  • Revision id: 720897
  • Created:
  • Creator: linfestus
  • Is current revision? No
  • Comment

Revision Content

{{HTMLSidebar("Global_attributes")}}{{SeeCompatTable}}

The translate global attribute is an enumerated attribute that is used to specify whether an element's attribute values and the values of its Text node children are to be translated when the page is localized, or whether to leave them unchanged. It can have the following values:

  • empty string and "yes", which indicates that the element will be translated.
  • "no", which indicates that the element will not be translated.

In addition, there is a third state, the inherit state, which is the  missing value default (and the invalid value default ).

When an element is in the translate-enabled state, the element's translatable attributes and the values of its Text node children are to be translated when the page is localized.

When an element is in the no-translate state, the element's attribute values and the values of its Text 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.

The translate IDL attribute must, on getting, return true if the element's translation mode is translate-enabled, and false otherwise. On setting, it must set the content attribute's value to "yes" if the new value is true, and set the content attribute's value to "no" otherwise.

 

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', "dom.html#attr-translate", "translate")}} {{Spec2('HTML WHATWG')}} No change from latest snapshot, {{SpecName('HTML5.1')}}
{{SpecName('HTML5.1', "dom.html#the-translate-attribute", "translate")}} {{Spec2('HTML5.1')}} Snapshot of {{SpecName('HTML WHATWG')}}, initial definition

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }}

See also

Revision Source

<p class="note">{{HTMLSidebar("Global_attributes")}}{{SeeCompatTable}}</p>
<p>The <strong>translate</strong> <a href="/en-US/docs/Web/HTML/Global_attributes">global attribute</a> is an enumerated attribute that is used to specify whether an element's attribute values and the values of its <code id="the-translate-attribute:text"><a href="https://html.spec.whatwg.org/multipage/infrastructure.html#text">Text</a></code> node children are to be translated when the page is localized, or whether to leave them unchanged. It can have the following values:</p>
<ul>
 <li><span style="font-family: Courier New;">empty string and "yes"</span>, which indicates that the element will be translated.</li>
 <li><span style="font-family: Courier New;">"no</span>", which indicates that the element will not be translated.</li>
</ul>
<p>In addition, there is a third state, <span style="font-family: Courier New;">the
 <i>
  inherit</i>
 state,
 <i>
 </i>
 </span>which is the&nbsp;
 <i id="the-translate-attribute:missing-value-default">
  <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#missing-value-default">missing value default </a></i>
 (and the
 <i id="the-translate-attribute:invalid-value-default">
  <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#invalid-value-default">invalid value default</a></i>
 ).</p>
<p>When an element is in the <dfn id="translate-enabled">translate-enabled</dfn> state, the element's <a href="https://html.spec.whatwg.org/multipage/dom.html#translatable-attributes" id="the-translate-attribute:translatable-attributes">translatable attributes</a> and the values of its <code id="the-translate-attribute:text-2"><a href="https://html.spec.whatwg.org/multipage/infrastructure.html#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 id="the-translate-attribute:text-3"><a href="https://html.spec.whatwg.org/multipage/infrastructure.html#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>
<p>The <dfn id="dom-translate"><code>translate</code></dfn> IDL attribute must, on getting, return true if the element's <a href="https://html.spec.whatwg.org/multipage/dom.html#translation-mode" id="the-translate-attribute:translation-mode-4">translation mode</a> is <a href="https://html.spec.whatwg.org/multipage/dom.html#translate-enabled" id="the-translate-attribute:translate-enabled-4">translate-enabled</a>, and false otherwise. On setting, it must set the content attribute's value to "<code>yes</code>" if the new value is true, and set the content attribute's value to "<code>no</code>" otherwise.</p>
<p>&nbsp;</p>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG', "dom.html#attr-translate", "translate")}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>No change from latest snapshot, {{SpecName('HTML5.1')}}</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5.1', "dom.html#the-translate-attribute", "translate")}}</td>
   <td>{{Spec2('HTML5.1')}}</td>
   <td>Snapshot of {{SpecName('HTML WHATWG')}}, initial definition</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Chrome</th>
    <th>Firefox (Gecko)</th>
    <th>Internet Explorer</th>
    <th>Opera</th>
    <th>Safari</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{ CompatVersionUnknown() }}</td>
    <td>{{ CompatVersionUnknown() }}</td>
    <td>{{ CompatVersionUnknown() }}</td>
    <td>{{ CompatVersionUnknown() }}</td>
    <td>{{ CompatVersionUnknown() }}</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Android</th>
    <th>Chrome for Android</th>
    <th>Firefox Mobile (Gecko)</th>
    <th>IE Mobile</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{ CompatVersionUnknown() }}</td>
    <td>{{ CompatVersionUnknown() }}</td>
    <td>{{CompatVersionUnknown() }}</td>
    <td>{{ CompatVersionUnknown() }}</td>
    <td>{{ CompatVersionUnknown() }}</td>
    <td>{{ CompatVersionUnknown() }}</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
 <li>All <a href="/en-US/docs/Web/HTML/Global_attributes">global attributes</a>.</li>
</ul>
Revert to this revision