GTranslate + IPB

Popular automatic website translation tool

GTranslate + IPB

Postby monkeyman » Fri May 13, 2011 10:20 am

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:

Code: Select all
<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?
monkeyman
 
Posts: 6
Joined: Fri May 13, 2011 10:13 am

Re: GTranslate + IPB

Postby Edvard » Fri May 13, 2011 3:26 pm

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
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: GTranslate + IPB

Postby monkeyman » Fri May 13, 2011 4:09 pm

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."
monkeyman
 
Posts: 6
Joined: Fri May 13, 2011 10:13 am

Re: GTranslate + IPB

Postby Edvard » Fri May 13, 2011 4:14 pm

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.
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: GTranslate + IPB

Postby monkeyman » Fri May 13, 2011 4:33 pm

Oh, OK, good advice. I should've guessed that myself.
monkeyman
 
Posts: 6
Joined: Fri May 13, 2011 10:13 am

Re: GTranslate + IPB

Postby monkeyman » Fri May 13, 2011 11:33 pm

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?
monkeyman
 
Posts: 6
Joined: Fri May 13, 2011 10:13 am

Re: GTranslate + IPB

Postby monkeyman » Sun May 15, 2011 10:26 pm

OK, I found the solution myself. Some stupid hook (plugin) was interrupting GTranslate. I just disabled it and it all works fine now.
monkeyman
 
Posts: 6
Joined: Fri May 13, 2011 10:13 am

Re: GTranslate + IPB

Postby Edvard » Mon May 16, 2011 3:45 pm

Good! Probably it was a jQuery library conflict.
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4183
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

cheap purses

Postby Adaenm » Wed Oct 05, 2011 12:42 pm

This is the most popular, newest, eye-catching purse and I guarantee you will be crazy about it at first sight.
Adaenm
 
Posts: 1
Joined: Wed Oct 05, 2011 12:42 pm


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

2GLux