The HTML translate attribute
The HTML translate attribute tells translation tools (such as browser translation and Google Translate) whether to translate an element's content. Use translate="no" to protect text like brand names and code, or "yes" (the default) to allow translation. It is a global attribute.
Overview
The translate attribute signals whether an element's text should be translated when the page is run through automatic translation. The value yes (the default) allows translation; no protects content that must stay exactly as written.
Mark proper nouns, brand and product names, code samples and usernames with translate="no" so they are not garbled by translation. The attribute is inherited, so setting it on a container protects everything inside it. Pair it with the lang attribute for the best results.
Syntax
<p>Built with <span translate="no">CodeShack</span>.</p>
Values
| Value |
|---|
| yes | no |
Example
<p>Welcome to <span translate="no">CodeShack</span> — your web development reference.</p>
Best practices
- Mark brand names, code samples and usernames with
translate="no". - Do not disable translation of real prose — that defeats accessibility for international readers.
- Set it on a container to protect everything inside, since the attribute is inherited.
- Use it together with the lang attribute.
Frequently asked questions
What does the translate attribute do?
yes) or left as-is (no).How do I stop a word from being translated?
translate="no", e.g. a brand name in <span translate="no">.What is the default value of translate?
yes — content is translatable unless you opt out.