- download a picture of Michel Buffa
WARNING: since 2015, and for security reasons, the image should be located on the same domain as the HTML page that contains the link (using a relative URL works well, for example, but linking a page on another domain will not work – it will keep its original name).
The HTML5 TRANSLATE ATTRIBUTE
HTML5 gives us a new translate attribute. This attribute is used to limit the impact of translation tools such as Google Translate by prohibiting the translation of certain content. In many cases some parts of a document should not be translated.
Use cases include:
- HTML pages that contain source code: you would certainly not like to see the Java or PHP or whatever programming language parts of your page translated into another spoken language!
- Video game Web sites that propose cheat codes; the codes do not have to be translated,
- Street names, author names in an “about” page must not be translated,
<p translate=“no”>This is a text in a paragraph element, that should not be translated: the p element has a translate=”no” attribute.<span> This part that is in a span element embedded within the paragraph. It does not have a translate attribute but inherits the translation-mode of the p and will not be translated too</span>. This is the end of the paragraph…</ p>