Google Blogoscoped

Tuesday, October 14, 2008

The HTML Syntax to Stop Google Translator

There are official specifications for the HTML language which are provided by the World Wide Web consortium. And then there’s more spontaneous additions to the language which are not part of the HTML specs (though they may or may not validate as HTML). The “img” tag was one such spontaneous addition, proposed and then quickly implemented by Marc Andreessen for the once popular Mosaic browser.*

Now, Google offers a new meta tag, as well as a special class value, to guide their translation tools (correction: the class value is new, the meta tag is older. Thanks Ionut!). To exclude a specific part of your page from being translated, you can use the “notranslate" value, e.g.**

Send us feedback at <span class="notranslate">sales at example dot com</span>.

To stop the whole page from being translated, you can use

<meta name="google" value="notranslate" />

Official additions to the language by standard bodies are often slow to be rolled out and sometimes complicated for everyday use, while at the same time being more all-encompassing, thinking vendor neutral and long-term. Ad-hoc additions by others are often solving a specific problem efficiently and easily, but are thinking more short-term. For instance, while webmasters would often ideally only like to write a single HTML file for different user agents, syntax like <meta name="google" ... /> looks to be rather vendor-specific, not targeted at other translation tools.

Another sort-of-addition to HTML by Google include the comment style <!-- google_ad_section_start -->...<!-- google_ad_section_end -->, which wraps a portion of text which you’d like your context-sensitive Google AdSense ads to put special focus on. Google was also one of the parties promoting the “nofollow” attribute value in HTML to be used for comment spam and, later on, text link ads.


*In comparison, take a look at how it was once suggested to handle images in XHTML2.

**Note if you simply want to indicate the language of a portion of text, there’s the “lang” attribute for e.g. paragraph elements, though user agent support may vary.


Blog  |  Forum     more >> Archive | Feed | Google's blogs | About


This site unofficially covers Google™ and more with some rights reserved. Join our forum!