Website Translator - Add Website
After completing the steps i got the code block in this format:
<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en',
includedLanguages: 'de,es,fr,it', layout:
google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false},
'google_translate_element');
}
</script><script type="text/javascript"
src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
I Added this to site (im using Firefox 12 with firebug have not tried other
browsers)
*Problem*
Firebug javascript throws an error
syntax error
new google.translate.TranslateElement(, 'google_translate_element');
water2buy.eu (line 320, col 40)
*Symptoms*
The result of this is that no language dropdown gets displayed.
*Investigation*
When i inspect the code it seems that the error above is not in the code -
ie. the syntax seems correct in the code but the error above still gets
thrown none the less.
*Workaround:*
It seems that adding a character return between the options passed to the
function works.
Note below i've added *a return *after 'de,es,fr,it', *<\n HERE>* layout:
<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en',
includedLanguages: 'de,es,fr,it',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE,
autoDisplay: false}, 'google_translate_element');
}
</script><script type="text/javascript"
src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
--
You received this message because you are subscribed to the Google Groups
"General" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-translate-general/-/T3rOO3UxSZ0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-translate-general?hl=en.