translate google dosent work.

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
tobias81
Forum Members
Forum Members
Posts: 29
Joined: Tue Jan 11, 2011 6:09 am

translate google dosent work.

Post 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 ?
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm

Re: translate google dosent work.

Post by M@rtijn »

Wrap the JS code in {literal} tags
Make your community a better place!
tobias81
Forum Members
Forum Members
Posts: 29
Joined: Tue Jan 11, 2011 6:09 am

Re: translate google dosent work.

Post 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 ?
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm

Re: translate google dosent work.

Post 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>
Make your community a better place!
tobias81
Forum Members
Forum Members
Posts: 29
Joined: Tue Jan 11, 2011 6:09 am

Re: translate google dosent work.

Post by tobias81 »

Where is it best to paste the code? I can not get the automatic functioning as it should.
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm

Re: translate google dosent work.

Post 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
Make your community a better place!
Post Reply

Return to “The Lounge”