Forum Archive - GTranslate + IPB

GTranslate + IPB
May 13, 2011 6:20 am by monkeyman
I'm trying to install GTranslate on IPB, but since it's pages are dynamically generated and written on PHP, I always get an error. Can't even save IPB template with GTranslate code. The problem is in this piece of code: <script type="text/javascript"> //<![CDATA[ if(jQuery.cookie('glang') && jQuery.cookie('glang') != 'ru') jQuery(function($){$('body').translate('ru', $.cookie('glang'), {toggle:true, not:'.notranslate'});}); function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;var lang=lang_pair.split('|')[1];jQuery.cookie('glang', lang, {path: '/'});jQuery(function($){$('body').translate('ru', lang, {toggle:true, not:'.notranslate'});});} //]]> And I'm pretty much sure it's due to $ presence. IPB parser thinks it's PHP and tries to parse it accordingly. Any workaround for this?
Re: GTranslate + IPB
May 13, 2011 11:26 am by Edvard
I think IPB is using Smarty template engine. If that is the case you need to use {literal} as described on http://edo.webmaster.am/gtranslate-widget
Re: GTranslate + IPB
May 13, 2011 12:09 pm by monkeyman
As far as I know, they use their own engine, not Smarty one. But anyway I tried inserting {literal} tags - didn't work. Still got this message: "There is a syntax error in the template, usually caused by PHP code not properly formed. Please correct the error and hit save again."
Re: GTranslate + IPB
May 13, 2011 12:14 pm by Edvard
Please write on their forum to find out how you can insert javascript code and not cause issues in the template syntax. I cannot change the code to be valid for their template engine.
Re: GTranslate + IPB
May 13, 2011 12:33 pm by monkeyman
Oh, OK, good advice. I should've guessed that myself.
Re: GTranslate + IPB
May 13, 2011 7:33 pm by monkeyman
I asked IPB support and they pointed me on pieces of code like this {$('body'), saying, I should try putting space before $. I did this way in couple places and template saved without any errors. But now I have another problem. When I click any flag, I get this error: "jQuery.cookie is not a function" (looked for it in Firebug). Could you help with that?
Re: GTranslate + IPB
May 15, 2011 6:26 pm by monkeyman
OK, I found the solution myself. Some stupid hook (plugin) was interrupting GTranslate. I just disabled it and it all works fine now.
Re: GTranslate + IPB
May 16, 2011 11:45 am by Edvard
Good! Probably it was a jQuery library conflict.
cheap purses
Oct 5, 2011 8:42 am by Adaenm
This is the most popular, newest, eye-catching purse and I guarantee you will be crazy about it at first sight.

SIMILAR TOPICS

Gtranslate MultisiteFeb 12, 2019 7:27 amReplies: 1Post by: infact_dat
Gtranslate: Error with numberFeb 20, 2019 1:20 amReplies: 1Post by: infact_dat
GTranslate 3.7.4, Joomla 3.9.3 - doGTranslate is not definedFeb 22, 2019 12:34 pmReplies: 1Post by: oase
Add-on gtranslate no longer worksFeb 2, 2019 6:01 amReplies: 1Post by: DarylDixon
Instragram and Gtranslate...!!!!Dec 19, 2018 11:18 amReplies: 1Post by: zackfernandes

Try GTranslate with a free 15 day trial