Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

translate
html
attribute
communitycreator

What is the translate attribute in HTML?

Programming Bytes

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Overview

In HTML, the translate attribute is used to identify whether the text content of an element can be translated to another language or not after web page localization.

Syntax

<div translate="yes">Hello</div>

Parameters

The translate attribute takes two values:

  • yes: This tells that the content of the element can be translated.

  • no: This tells that the content of the element should not be translated.

Example

<html>
 <head>
 </head>
 <body>
   <footer>
    <small>&#169; 2022 <span translate="no">Educative.io</span></small>
  </footer>
 </body>
</html>

Explanation

Lines 5-7: We create a footer section and add a span element that contains the name of the brand inside it. Because there is no need to translate the name of the brand or product while localizing a website, we add the translate="no" tag to the span element. This makes sure that the content of the span element is not translated when the web page is translated to other languages using the translation tool.

Note: The translate attribute is newly added in HTML5.

RELATED TAGS

translate
html
attribute
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring