47

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?

4 Answers 4

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.

9
  • 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... Nov 5, 2010 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. Nov 5, 2010 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? Nov 16, 2010 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 - superuser.com/questions/326938/…
    – Paul C
    Aug 23, 2011 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, 2012 at 16:56
15

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

5
  • 2
    Or set the header using Apache: Header set content-language "en"
    – John Conde
    Nov 4, 2010 at 22:03
  • @John, yep. (that is what i meant that he can send the http header from the server) Nov 4, 2010 at 23:28
  • Hmm, well supposedly using <html lang="en"> is better than that meta tag, but I will give it a try and see what happens :) Nov 5, 2010 at 2:12
  • I've had the same problem and I've verified this works for me in Chrome 19 dev
    – Olly
    Feb 16, 2012 at 22:59
  • 1
    <html lang=en> did not fix it for me, but the 'content-language' meta tag did.
    – chovy
    May 20, 2013 at 22:05
15

use this meta to skip the Google's translate

<meta name="google" content="notranslate" />
8
  • 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, 2012 at 20:06
  • @Su': according to the google webmaster the google translate should be skipped. and its works for my site.
    – Krish
    Jun 20, 2012 at 21:29
  • 1
    @krish doesn't that do what I mention in the question and prevent all translation by users? Jun 21, 2012 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, 2013 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, 2019 at 21:07
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.

2
  • 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. Nov 4, 2010 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 5, 2010 at 6:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.