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:
W3C recommendation: Use the
lang
and/orxml:lang
attributes in the html tag:<html lang="en" xml:lang="en" xmlns= "http://www.w3.org/1999/xhtml">
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">
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
Make Link in Table Cell Fill the Entire Row Height
Html5 Validation When the Input Type Is Not "Submit"
Why Would Margin Not Be Contained by Parent Element
How to Override Inline !Important
Play Sound File in a Web-Page in the Background
What Is the Character Limit on Url
How to Upload a File to My Server Using HTML
Change Name of Download in JavaScript
How to Create a Transparent Triangle with Border Using CSS
How to Select an Element That Has a Certain Class
Html/Css: Make a Div "Invisible" to Clicks
CSS Selector with Period in Id
HTML Radio Buttons Allowing Multiple Selections