Page 1 of 1

[SOLVED] Add Google Translate to page?

Posted: Thu May 27, 2010 2:21 pm
by michaywood
Hello CMSMSers,

I have seen there is a MLE version of CMSMS but I'm not totally comprehending how it functions (having to create duplicates of every page in every language you want?)

I simply want to use Google Translate, so I don't have to do any translating myself, but people can select what language is suitable for them.

IF SOMEONE HAS A BETTER/ SIMPLER IDEA, LET ME KNOW!!!

I know the translations won't be perfect, but it will be better than nothing. From using the Google Translate Tools & Resources page, Google gives me the code:

Code: Select all

<div id="google_translate_element"></div><__script__>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en',
    includedLanguages: 'es'
  }, 'google_translate_element');
}
</__script><__script__ src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></__script>
So, after my tag, I merely past that code into my template. For testing purposes, I didn't put ANYTHING within the of my document except for the above code from Google. After saving, I open up the URL to view the page, and this error message is the only thing that is displayed on the page:

string(113) "Smarty error: [in tpl_body:23 line 4]: syntax error: unrecognized tag 'new' (Smarty_Compiler.class.php, line 590)"

What is the best way to go about fixing this? Would be nice to have a simple way to translate from one language to the next in an instant without me, the english-only speaking american, having to do any translating.

Cheers!

Re: Add Google Translate to page?

Posted: Thu May 27, 2010 2:25 pm
by michaywood
OR... is the Translation Manager module the best module for this?

Re: Add Google Translate to page?

Posted: Thu May 27, 2010 2:26 pm
by Rolf
Hi michaywood

Try to put {literal}{/literal} around the

grtz. Rolf

Re: [SOLVED] Add Google Translate to page?

Posted: Wed Mar 16, 2011 1:27 pm
by velvet_grooves
Hi,

It would be great if I could work out how to use the translate feature, but I can't work this out, even with the help documentation.

I see people with different language buttons on their pages. How do I apply to this different languages, or even with Google Translate?

Re: [SOLVED] Add Google Translate to page?

Posted: Wed Mar 16, 2011 3:27 pm
by Rolf
velvet_grooves wrote:I see people with different language buttons on their pages. How do I apply to this different languages
This is my way: http://forum.cmsmadesimple.org/viewtopi ... =4&t=48112 >>

Or Gorans: http://www.i-do-this.com/blog/25/Anothe ... CMSMS-Page >>
But there is more to find in the forum and Forge.

grtz. Rolf

Re: [SOLVED] Add Google Translate to page?

Posted: Wed Mar 16, 2011 3:33 pm
by velvet_grooves
You're a life saver! Thanks! :D

Isn't there a CMS Made Simple book coming out soon full of tutorials?

Re: [SOLVED] Add Google Translate to page?

Posted: Wed Mar 16, 2011 4:09 pm
by Rolf
velvet_grooves wrote:Isn't there a CMS Made Simple book coming out soon full of tutorials?
As far as I know there are two (e)books for sale.
Read http://www.cmsmadesimple.org/2010/03/10 ... ers-guide/
and Duketown has written a book

®

Re: [SOLVED] Add Google Translate to page?

Posted: Wed Mar 16, 2011 5:08 pm
by velvet_grooves
Yeah I got the 1.6 one, however, it needs updating ;) Found a few bits which were either out of date or didn't work.

Sure I read about a new book being written for about May time...

Re: [SOLVED] Add Google Translate to page?

Posted: Fri Mar 18, 2011 3:49 am
by velvet_grooves
I can't seem to work out a way of translating products in the products pages. Any ideas how this might work? I managed to get your tutorial to work though.