google translate on website

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
dhottinger
New Member
New Member
Posts: 6
Joined: Wed Jan 27, 2010 6:04 pm

google translate on website

Post by dhottinger »

I would like to have the google translate show on my cms website.  They have the code on their site to copy and paste into a website: 
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en'
  }, 'google_translate_element');
}


When I copy this code, I get a smarty error.  Is this not possible with cms made simple?  I would like visitors to choose their language, and have the entire page translated.

thanks,
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: google translate on website

Post by Dr.CSS »

If you read one of the default install templates at the top it tells you...

{* the literal below and the /literal at the end are needed whenever there are {"curly brackets"} as smarty will think it's something to process and will throw an error *}

So anything you put in a page or template that has {  }  in it and is not one of the tags cmsms uses then you need the {literal} stuff around it...
dhottinger
New Member
New Member
Posts: 6
Joined: Wed Jan 27, 2010 6:04 pm

Re: google translate on website

Post by dhottinger »

Got it thanks,

I missed the literal settings thanks for the heads up. 8)
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: google translate on website

Post by Dr.CSS »

There is all kinds of interesting stuff that can be learned from a default install of CMS Made Simple on the front end and in the back end looking thru templates and style sheets...

Please to mark the original post as [solved] in the subject line...
Post Reply

Return to “The Lounge”