This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

translate

Summary

The translate attribute indicates whether the element’s content and attribute values should be translated or not.

Applies to [HTMLElement](/dom/HTMLElement)
Two values allowed: "yes" and "no". The information will be inherited. When no translate flag is set, "yes" is default.

Some automated translation services apply “no” to elements like the code element.

Elements with translate attributes of different values may be nested to indicate a chunk of text that should be translated within a container that should not be translated, or vice versa.

Overwriting “no” with “yes” is not widely supported by translation services yet.

Examples



<p>The national motto of France is
<i lang="fr" translate="no">Liberté, Egalité, Fraternité</i>
(freedom, equality, brotherhood).</p>


<code translate="no">
<section id="translate-attribute">
<h2><span translate="yes">The <span translate="no">translate</span> attribute<h2>
<p><span translate="yes">The <span translate="no">translate</span> attribute indicates whether the element’s content and attribute values should be translated or not.</span></p>
</section>
</code>

Related specifications

HTML5
W3C Recommendation

See also

External resources

Using HTML’s translate attribute