The translate
global attribute is an enumerated attribute that is used to specify whether an element's translateable attribute values and its Text
node children should be translated when the page is localized, or whether to leave them unchanged. It can have the following values:
- empty string or
"yes"
, which indicates that the element should be translated when the page is localized. "no"
, which indicates that the element must not be translated.
Although not all browsers recognize this attribute, it is respected by automatic translation systems such as Google Translate, and may also be respected by tools used by human translators. As such it's important that web authors use this attribute to mark content that should not be translated.
Examples
In this example, the translate
attribute is used to ask translation tools not to translate the company's brand name in the footer.
<footer> <small>© 2020 <span translate="no">BrandName</span></small> </footer>
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'translate' in that specification. |
Living Standard | No change from latest snapshot, HTML 5.1 |
HTML 5.1 The definition of 'translate' in that specification. |
Recommendation | Snapshot of HTML Living Standard, initial definition |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
translate | Chrome Full support Yes | Edge Full support 79 | Firefox No support No | IE No support No | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android No support No | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
See also
- All global attributes.
- The
HTMLElement.translate
property that reflects this attribute. - Using HTML's translate attribute.