I\'m trying to include google website translator on my website. I want to use the automatic thing so the bar shows up if your browser language is different to the page langu
I saw another example here:
Detect User's Preferred Language and Google Translate Automatically
This had the parameter autoDisplay: false,
To get only the translation bar when the site language doesn't match I have deleted the container, and used autoDisplay: true,
I get the bar when in another language, but no drop down.
To display the translator only when your page is different from the user's page, have a server side check and only include the code if necessary.
See Getting Browser Language
Your URL is incorrect. Add "http:". See working example below.
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en',
layout: google.translate.TranslateElement.FloatPosition.TOP_LEFT},
'google_translate_element');
}
</script>
<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>