Page 1 of 1

translate google dosent work.

Posted: Tue Jan 25, 2011 1:32 pm
by tobias81
Hi there.
I do a homepage and that must be on many language.
When i google around i find google translate code and the only thing i must do is copy this code and past it on the homepage.

Code: Select all

<div id="google_translate_element"></div><__script__>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'sv'
  }, 'google_translate_element');
}
</__script><__script__ src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></__script>
But when i do that i get this wrong messenge!

Code: Select all

string(120) "Smarty error: [in content:content_en line 6]: syntax error: unrecognized tag 'new' (Smarty_Compiler.class.php, line 590)"
What is wrong ? Or have someone another tip ?

Re: translate google dosent work.

Posted: Tue Jan 25, 2011 3:06 pm
by M@rtijn
Wrap the JS code in {literal} tags

Re: translate google dosent work.

Posted: Tue Jan 25, 2011 3:08 pm
by tobias81
M@rtijn wrote:Wrap the JS code in {literal} tags
Sorry i don“t know what you mean.
Im not good on code. Can you give me a exemple ?

Re: translate google dosent work.

Posted: Tue Jan 25, 2011 3:13 pm
by M@rtijn
Just like it says, wrap your code in {literal} tags ;D
It's not rocket science!

Code: Select all

<__script__ type="text/javascript">
{literal}the piece of code{/literal}
</__script>

Re: translate google dosent work.

Posted: Tue Mar 01, 2011 5:30 am
by tobias81
Where is it best to paste the code? I can not get the automatic functioning as it should.

Re: translate google dosent work.

Posted: Tue Mar 01, 2011 12:05 pm
by M@rtijn
Did you wrap the Google Translate code in {literal} tags, like stated above?

If it's still not working then, I guess the problem is not CMSMS related. Maybe you can get more information on the Google forums? http://groups.google.com/group/google-translate