Coder Perfect

In Chrome, how can I turn off Google Translate from HTML?

Problem

I recently completed the design of a website for a French restaurant. Although the website is in English, I believe there is enough French on the site (labeled photographs of menu items) to inspire visitors to use Chrome to translate the website.

Is there anything I can do in the html to prevent Chrome from requesting that the website be translated? I assumed it would be something along the lines of html lang=”en”>, but it doesn’t seem to work.

Any ideas?

Thanks

Asked by twinlakes

Solution #1

Add a no=”no” attribute to your html> tag, like follows:

<html translate="no">

MDN Reference

is exclusive to Google, although there are other translation services available.)

Between the head> and the /head> tags, add the following tag:

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

Documentation reference

Answered by Matthew Adams

Solution #2

So here’s the final answer I came up with:

<!DOCTYPE html>
<html lang="en" class="notranslate" translate="no">
<head>
  <meta name="google" content="notranslate" />
</head>
<body>
...
</body>
</html>

This worked for me.

Answered by ─░brahim Sakac─▒

Solution #3

I couldn’t get the meta tag in the head> to function, but

class=”notranslate”

Adding it to a parent div (or even the body>) worked and gives you more control over the material you don’t want to be translated.

Answered by edelans

Solution #4

Solution:

<html lang="en" class="notranslate" translate="no">    <!-- All translators -->
 <head><meta name="google" content="notranslate" /> <!-- Just for google -->
</head>                                                <!-- Close head      -->

The more straightforward method is to simply add the translate=”no” property. This can be done with divs, text, and other elements. Here’s an example:

Note that this example has some problems with the StackOverflow viewer.

Disclaimer: This answer has already been given, and it can be seen on the Community Wiki.

Answered by Tiago Rangel de Sousa

Solution #5

You can set the Material-Language header in your response (source) to the proper language if you want something that will work for any stuff on your site (including non-HTML content) (in my case, en-US).

e appropriately), but non-native readers will still be able to translate your site into their own language, and it will function properly.

(That BS also goes away for my use case, as Chrome was offering to translate well-formatted JSON from Latin to English.)

Answered by BrainSlugs83

Post is based on https://stackoverflow.com/questions/12238396/how-to-disable-google-translate-from-html-in-chrome