Having trouble translating Google on a website?

So, I use the Google translation tool for my website, I configure it through: https://translate.google.com/manager/website

In display mode, I always choose automatic, but it looks like ALWAYS displays a banner, even if they state that it will ONLY show if the browser is not the language of the site (which is EN)

What's happening? Is their tool broken? is there any way to use this tool to just show if the language is not en?

+2
source share
1 answer

Paste the code below into your website. The languages โ€‹โ€‹mentioned in includeLanguages โ€‹โ€‹in googleTranslateElementInit () will be displayed on your website.

I suggest that you insert this into the header or footer section of the website so that the translation function appears on every page of your website.

<div id="google_translate_element"></div> <script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'en,fr,es,it,de'}, 'google_translate_element'); } </script> <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> 

Also, if you are looking for automatic translation in a specific language, use this code along with the above.

 <script> (function() { if(!window.location.hash) { window.location = window.location + '#googtrans(en|fr)'; window.location.reload(); } })(); </script> 
+1
source

All Articles