68

I have a chat website that is highly dynamic and when visiting it with Google Chrome, the translation bar appears offering to translate the site. While the translation of dynamic content works better than I'd have expected, it doesn't work well enough for my purpose and doesn't even make much sense in a chat.

Is there some hint I can put into my site so that visitors with Chrome would not see the translation bar?

KyleMit
  • 30,350
  • 66
  • 462
  • 664
swij
  • 683
  • 1
  • 5
  • 4
  • Out of curiosity, if you explicitly [specify the language](https://www.w3.org/TR/html5/dom.html#attr-lang) (``) of the page, does that override Chrome attempting to auto-detect the language? If Chrome then thought your tagged page was anything but what it's tagged, that sounds like a bug. – Nick T Jun 27 '17 at 16:57

5 Answers5

137

Insert this to the head section of your web page.

<meta name="google" content="notranslate">

Source: Meta tag that Google understand - Search Console Help

mems
  • 1,224
  • 1
  • 19
  • 27
Bertrand Marron
  • 21,501
  • 8
  • 58
  • 94
  • Found a little documentation about the meta tag on Google's support site: http://support.google.com/translate/?hl=en – metavida Feb 29 '12 at 15:57
  • 5
    If I understand correctly this will not only disable the bar, but also disable translation of the site at translate.google.com – Roger Ertesvag Jun 14 '12 at 19:00
  • 1
    cont... I would like to allow the site to be translated, but not encourage it by having this bar show up. So is there a way to just disable the bar, not the translation? – Roger Ertesvag Jun 14 '12 at 19:07
  • 2
    The meta solution only works partially. By partially, I mean that when the page first loads, the translation bar does NOT show, which is what I want. But if I hit 'refresh', then the bar shows up. Is this intentionally? – Jerry Hardaway Nov 18 '11 at 20:52
  • i experienced the same effect. nothing can be done about it :( – Andres SK Dec 03 '11 at 17:53
  • 1
    You can see the "shows toolbar on refresh" behavior on this page, which has the tag: http://jsbin.com/ehavan/3 Alternatively, here's the same page without the tag: http://jsbin.com/ehavan/2 – metavida Feb 29 '12 at 15:55
  • 1
    Interestingly, the "" tag has no such attribute as "value" - it should be "content". So whoever is recommending using "value" is recommending a non-standard attribute that just happens to be tolerated. The correct "content" will definitely work, though. – thomasrutter Mar 16 '15 at 23:45
  • @thomasrutter it used to say `value` on Google’s doc. – Bertrand Marron Mar 17 '15 at 16:48
  • It still does, I checked. I have to assume they made a mistake. – thomasrutter Mar 17 '15 at 23:37
  • Note that you have to hard refresh (or close and reopen chrome) before the translate message will disappear; not just a normal refresh. – Carter Medlin Aug 29 '18 at 23:07
  • Why are people copying the answer get more + ups than the original answer.. ? – digitaldonkey Apr 16 '21 at 14:21
28

The Meta Value should be "content", not "value"

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

Update: I understand that normal meta tags use content to assign the value, however this is a rare case where "value" is actually the correct syntax. i.e. is confirmed to remove the translate bar.

gius
  • 9,289
  • 3
  • 33
  • 62
digitaldonkey
  • 2,431
  • 1
  • 20
  • 16
16

If you want to block a section (ie: for the original question just the chat window) you can use

  class=notranslate

From: http://support.google.com/translate/?hl=en#2641276. If you don't mind your web page being translated by Google Translate, except for a particular section (like an email address, for example), just add class=notranslate to any HTML element to prevent that element from being translated. For example:

Email us at <span class="notranslate">sales at example dot com</span>
Jed Fox
  • 2,979
  • 5
  • 28
  • 38
Aaron Sherman
  • 3,789
  • 1
  • 30
  • 33
  • Perfect, this is oftentimes a lot more useful than disabling translation altogether as suggested by the other answers. Plus you can still give than class to the entire body tag. – kontur Sep 29 '17 at 06:43
  • This is the right answer because it leaves the rest of the site accessible to anyone who doesn't read the original language – Toni Leigh Dec 02 '19 at 20:22
4

If you add the following code

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

inside <head></head> it will disable the appearence of the translation bar, but will also disable translation at Google Translate.

For more info check http://support.google.com/translate/?hl=en#2641276.

Francisco Costa
  • 6,713
  • 5
  • 34
  • 43
1

Use the new global attribute. translate.

in my case i used it straight into html

<html lang="en" translate="no">

but you can set it on a specific element. example

<footer>
   <small>© 2020 <span translate="no">BrandName</span></small>
</footer>

MDN ref

Amassuo
  • 64
  • 5