Disable Google Translate for specific page or paragraph.


To disable Google Translate from translating a specific portion of a website, whether it is a page, div, paragraph or span use the following built in class:

<span class="notranslate">This text will not be translated. </span>

I have found the span class to be the most useful. It will also work for the following.

Specific elements:

<h1>This text will translate <span class=”notranslate”>This text will not translate. </span></h1>

Paragraphs:

<p class=”notranslate”>This paragraph will not translate. </p>

DIV’s:

<div class=”notranslate”><p>This content block will not translate.</p></div>

You can test this right here by translating this page into another language:

Sample Text:

This text will not be translated.This text will not be translated.This text will not be translated.This text will not be translated.This text will not be translated.This text will not be translated.This text will not be translated.This text will not be translated.This text will not be translated.This text will not be translated.
Why would you ever want to do this? For example we have a website for Business X; the website is primarily in english, but they have some foreign customers. Business X is not large enough to have full international versions of their website where every page is professionally translated and maintained. Because of this Business X uses Google Translate on their website so that their foreign customers will at least be able to get the gist of what their website is saying. However if there is one very important page that NEEDS to be correctly translated, Business X can have that page professionally translated so the language will be accurate. But then the problem emerges that google translate will try to translate this already perfect language, and will just end up making it incorrect. In this example you would want to disable google translate for the specific page or paragraph in question so that the professional translation will remain untouched.

This is just one example (that I have encountered in real life) of why you would want to disable Google Translate for a specific section of a website.

There are also many interesting possibilities using the Google Translator Toolkit. But that is another can of worms.

2 Comments

Add yours

+ Leave a Comment