Why would my website language be incorrectly detected, and how do I set it to the right language?
Try this in the <head>
section:
<meta charset="UTF-8">
<meta name="google" content="notranslate">
<meta http-equiv="Content-Language" content="en">
One thing to note is that when Google suggests, "This page is in XYZ" and offers translation, it doesn't necessarily mean it thinks the entire page is in that language. Even if it thinks that just a very small part of the page is in that language it offers the same option to translate the page.
In your example, if you click on the translate link, the only part that appears to get "translated" is the visible local part of the email address. faith
becomes Faith
.
Checking the HTML source of the page shows that this element is (heavily) HTML entity encoded (the href
attribute is both %-encoded (URL encoded) and HTML entity encoded) - presumably in an attempt to stop email harvesters:
<a href='mailto:f%61i%74%68%40fa%69th%62ot.c%6F%6D'>faith@faithbot.com</a>
It may be this encoding that is fooling Google translate? It may not be seeing it as an email address? I notice that in Chrome, the %40
(encoded @
) is not decoded when Chrome shows the source of the link in the tooltip when the user hovers over it. Also, if the user selects "Copy email address" from the context menu, the email address that is copied is only HTML entity decoded, it is not %-decoded (ie. f%61i%74%68%40fa%69th%62ot.c%6F%6D
) - so this is a potential usability issue.
Solution
According to the Google help docs, you can try adding the following tag around specific elements you don't want considered for translation:
<span class="notranslate">....</span>
You might just be able to add class="notranslate"
to the anchor, or you may need the entire element, I'm not sure.
There is also a possibility you might be able to use HTML5's translate="no"
attribute?
Reference:
https://stackoverflow.com/questions/9628507/how-can-i-tell-google-translate-to-not-translate-a-section-of-a-website