Why Does Chrome Incorrectly Determine Page Is in a Different Language and Offer to Translate

Why does Chrome incorrectly determine page is in a different language and offer to translate?

Update: according to Google

We don’t use any code-level language information such as lang
attributes.

They recommend you make it obvious what your site's language is.
Use the following which seems to help although Content-Language is deprecated and Google says they ignore lang

<html lang="en" xml:lang="en" xmlns= "http://www.w3.org/1999/xhtml">
<meta charset="UTF-8">
<meta name="google" content="notranslate">
<meta http-equiv="Content-Language" content="en">

If that doesn't work, you can always place a bunch of text (your "About" page for instance) in a hidden div. That might help with SEO as well.

EDIT (and more info)

The OP is asking about Chrome, so Google's recommendation is posted above. There are generally three ways to accomplish this for other browsers:

  1. W3C recommendation: Use the lang and/or xml:lang attributes in the html tag:

    <html lang="en" xml:lang="en" xmlns= "http://www.w3.org/1999/xhtml">
  2. UPDATE: previously a Google recommendation now deprecated spec although it may still help with Chrome. : meta http-equiv (as described above):

    <meta http-equiv="Content-Language" content="en">
  3. Use HTTP headers (not recommended based on cross-browser recognition tests):

    HTTP/1.1 200 OK
    Date: Wed, 05 Nov 2003 10:46:04 GMT
    Content-Type: text/html; charset=iso-8859-1
    Content-Language: en

Exit Chrome completely and restart it to ensure the change is detected. Chrome doesn't always pick up the new meta tag on tab refresh.

Google Chrome doesn't offer translation for my website

You can force the Chrome Translate dialog to show up by adding the lang tag with the language. This should work as long as the user doesn't have the settings in Chrome to never translate. Some people turn off that dialog in the chrome settings because they do not want to be annoyed by the translate dialog.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language

sample html.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>
<body>
<p>这只是一个测试。</p>
</body>
</html>

chrome shows page is in malay but my web page has been written in english

It depends on what editor you used to save the file. Assuming you used Dreamweaver, there is a thing called BOM (byte order mark), when you look at the page properties in Dreamweaver, there should be encoding setting and the check box for BOM. It's possible that either the page was saved with Malay encoding. BOM signals that the text stream (file) is Unicode when set.

How to remove translation warning by Google chrome browser? Chrome saying page is in Malay when its in English

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

But it will disable translate for people who want to translate page to their native non-english languages



Related Topics



Leave a reply



Submit