48

Several of my site's pages are appearing in search results with [Translate this page] next to it. When I click that it takes me to Google Translate and translates my page "from Catalan to English".

The pages are in English but have a couple of foreign words (actually Japanese romanisations, not Catalan) that appear to be tripping Google up.

A few weeks ago I set the html tag to <html lang="en"> which from research appears to be the best method to specify the language of a document. Google has cached the pages with this attribute but it is still offering to translate.

More research led me to a "notranslate" attribute which prevents translation entirely: <html lang="en" class="notranslate">. The problem now is users cannot translate from English to their desired language!

Are there any other solutions that force Google to parse my site as English only?

Flimm
  • 1,458
  • 2
  • 11
  • 17
DisgruntledGoat
  • 21,588
  • 5
  • 54
  • 101

4 Answers4

23

Google does not use language meta-data since we've found that it's generally incorrect. Using HTTP headers, HTML meta tags or element-level lang-attributes does not have an impact on Google's language recognition, so unless you want to do that for other purposes (eg screen-readers), you can probably skip on that.

One thing to keep in mind is that Google has no problem recognizing multiple languages per page. So even if we should recognize that a part of the page is say in Italian (perhaps when you write about Italian hotels), and we show a "translate this page" link in the search results, we'll probably still be able to recognize that it's mostly in English. A simple way to check that is to use the advanced search options to select a specific language and do a site:-query for your site.

John Mueller
  • 7,451
  • 1
  • 20
  • 26
  • 1
    Great insight John, thanks. So you're saying there's no way to stop Google showing [Translate this page]? My pages do appear in the English-only advanced search. My main concern is users - showing the translation link implies the entire page is in a different language. Personally I tend to avoid those links when I see them. There are also other sites using the same words that don't get the translation link... – DisgruntledGoat Nov 05 '10 at 17:16
  • 3
    That's correct - at the moment there's no way to make the "Translate this page" link disappear from the webmaster's side. I'll pass your feedback on to the team though, maybe that's something they can consider for the future. – John Mueller Nov 05 '10 at 18:08
  • 2
    Thanks @John. The main problem is that Google believes the pages are in Catalan, when they are not. I'm surprised that Google completely ignores the language tag - why not at least use it as a hint? – DisgruntledGoat Nov 16 '10 at 12:49
  • 1
    Is there any update on this as I have seen people here and there on the internet asking the same question and in some instances causing a never-ending loop - http://superuser.com/questions/326938/can-i-disable-chromes-auto-translate-function-for-visitors-to-a-given-page-on-my/326949#326949 – Paul C Aug 23 '11 at 14:20
  • 4
    Anecdotally, I have to add that I have personally seen this (in Chrome for Windows) when I'm in PHPMyAdmin where Google thinks the page is in Italian and offers to translate. It's always struck me as bizarre considering I've never noticed any non-English words in PHPMyAdmin. – huzzah Jun 20 '12 at 16:56
  • And yet, clearly, this system is not foolproof. Hooray for the machines! – Jack Oct 06 '16 at 12:14
  • Is there a way to tell what part of the page is being detected as a different language? – MikeSchem Apr 06 '17 at 17:10
  • Hmm, I don't wish to be rude, but this is a very unsatisfying response. Google's position is that they don't care that their software routinely gives incorrect results, and they refuse to provide a way for webmasters to override this and tell the software the right answer because "we've found that it's generally incorrect"? At least if Google paid attention to language tags, webmasters could fix them if they're wrong. As is, as far as I can see there is absolutely nothing one can do when Google gets it wrong. – Jay Apr 16 '19 at 14:16
  • "One thing to keep in mind is that Google has no problem recognizing multiple languages per page." - I accept that you meant "no problem" to mean that the browser is able to recognise different languages, however it's untrue in in the literal meaning of "no problem" as it clearly does have a problem when it suggests that pages visibly in English have content in other languages. It feels that Chrome is trying to be a little too clever, is prone to error, and lacks adequate support to help developers give it a hand and introduce a feedback loop for improvement when it gets things wrong. – Nick Nov 05 '19 at 11:15
16

You should add the meta tag

<meta http-equiv="content-language" content="en" />

You could also send the Content-Language HTTP header from the server if you have access to it.

More info at http://www.w3.org/International/questions/qa-http-and-lang

15

use this meta to skip the Google's translate

<meta name="google" content="notranslate" />
Krish
  • 357
  • 5
  • 11
  • 2
    This was actually submitted as an answer previously, then deleted by the owner without explanation. @danlefree is there a reason this isn't valid? It still appears on a recently-updated Webmaster Tools help page. – Su' Jun 20 '12 at 20:06
  • @Su': according to the google webmaster the google translate should be skipped. and its works for my site. – Krish Jun 20 '12 at 21:29
  • 1
    @krish doesn't that do what I mention in the question and prevent all translation by users? – DisgruntledGoat Jun 21 '12 at 16:06
  • This might be totalitarian. If the user's language is different than content-language meta tag, you would probably want a language translation. – chovy May 20 '13 at 22:06
  • If you right click on the web page in chrome, it still gives you the option to translate even if you have that meta tag... – NewBie1234 Jan 23 '19 at 21:07
  • Works for what I wanted to do: to stop showing the Google Translate bar. (Why? The page was already bilingual, something Google Chrome failed to detect.) – Fabien Snauwaert Jun 21 '19 at 08:33
  • @FabienSnauwaert Any language information provided in your page like ?? – Krish Jul 12 '19 at 11:58
  • This disables translation even to languages other than English, which the question post explicitly rejects. – Flimm Jun 09 '22 at 08:40
5

You may be able to look at the request Accept-Language header to dynamically add/remove the class="notranslate" attribute when the language string includes en.

According to Web Master World you can apply class="notranslate" to only the content it affects (i.e. the 'couple of foreign words') and hopefully avoid the English/English translate box.

Metalshark
  • 3,683
  • 2
  • 20
  • 39
  • 1
    But if they wanted to translate from English to another language, then it would be fetched by Google, not the browser, and presumably Google would use "English" in the accept-language header. – Lèse majesté Nov 04 '10 at 22:41
  • Google usually does use English for google.com, google.co.uk, etc however what about the crawler for google.de, etc? But regardless, selective use of the class seems the best way out of this. – Metalshark Nov 05 '10 at 06:18