Hey EI Tech,
All apologies on moving this prematurely!
After looking it over and talking to Shane about the way ExpressionEngine handle in-line JavaScript, we figured out (hopefully) what the hiccup here.
Trey this for us, OK?
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en', layout: google.translate.TranslateElement.FloatPosition.TOP_RIGHT
}, 'google_translate_element');
}
The line breaks around the “{}” pair in your JavaScript function attributes are the key.
More often than not, when ExpressionEngine sees anything between the 2 braces on the same line, it wants to parse them as EE tags, and breaks JS like this. Generally, breaking them up across multiple lines will prevent EE from trying to do that.
Let me know if that doesn’t square this up.
Cheers,