Ajax request compatibility on drupal site V7

Popular automatic website translation tool

Ajax request compatibility on drupal site V7

Postby showlib » Fri Jan 24, 2014 7:47 pm

Hi Gtranslate support team,

My Drupal development team face a lot of problem with Gtranslate impacts on drupal modules...

First one, the admin_menu module doesn't work anymore due to the fact that the ajax javascript request is blocked (due to htaccess?).

It's the same thing on other UI, including Views module, all because blocked ajax requets...

They ask :
which rule specify for ajax requets ?
If there's not a generic rule, how define it by path ?

We use Gtranslate Pro on https://test.showlib.com/fr/views/ajax for instance

Thank you for your feed-back
showlib
 
Posts: 25
Joined: Fri Dec 20, 2013 2:39 pm

Re: Ajax request compatibility on drupal site V7

Postby Yana » Sat Jan 25, 2014 1:26 am

Hi,
GTranslate redirection rules are not blocking anything.Can you please send the username /password , so I can check your website and understand what the problem is?
Regards,

Yana Ghahramanyan - 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
Yana
 
Posts: 4133
Joined: Thu Jan 12, 2012 6:21 pm

Re: Ajax request compatibility on drupal site V7

Postby showlib » Sat Jan 25, 2014 3:01 am

Ok, i've sent you the access.

Thanks you
showlib
 
Posts: 25
Joined: Fri Dec 20, 2013 2:39 pm

Re: Ajax request compatibility on drupal site V7

Postby Yana » Sat Jan 25, 2014 3:18 pm

Thank you. I'll check you ASAP.
Regards,

Yana Ghahramanyan - 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
Yana
 
Posts: 4133
Joined: Thu Jan 12, 2012 6:21 pm

Re: Ajax request compatibility on drupal site V7

Postby showlib » Sat Jan 25, 2014 4:51 pm

Ok

Our Developments are quite impacted by this !

Don't Forget us please...

Regards
showlib
 
Posts: 25
Joined: Fri Dec 20, 2013 2:39 pm

Re: Ajax request compatibility on drupal site V7

Postby showlib » Sun Jan 26, 2014 5:45 am

Hi Yana,

Thank you for your answer.

The step by step :

go to https://test.showlib.com
Select english flag
go into the menu : Residential Services / All Services
you have a map which display pins. When you change the country filter, without gtranslate the map is re-generated only with the services of the selected country. With translate, the ajax request is blocked and nothing happen when we change the country.

Thanks for tour help
showlib
 
Posts: 25
Joined: Fri Dec 20, 2013 2:39 pm

Re: Ajax request compatibility on drupal site V7

Postby Yana » Sun Jan 26, 2014 4:40 pm

Hi,
Please try to add class="notranslate" to the wrapper element.
Regards,

Yana Ghahramanyan - 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
Yana
 
Posts: 4133
Joined: Thu Jan 12, 2012 6:21 pm

Re: Ajax request compatibility on drupal site V7

Postby showlib » Mon Jan 27, 2014 10:47 am

Yana,

I don't know if you understand properly or your knowledge of drupal, when you say that you support it, is sufficient.
You are suggesting to add class="notranslate" to every wrapper element of every contribution module that is doing an ajax request. It is definitely not doable in case of module upgrade.
I suggest that you give the right htaccess rewrite rules to avoid every ajax request to be translated by gtranslate for the admin path or a generic one.
Your solution is not acceptable for a project that use plenty of contribution modules doing their own ajax request on different custom path, it is impossible.
we are using those rewrite rules, according to your poor documentation:
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)/(.*)$ /$1/$3 [R=301,L]
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)$ /$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/js/
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA]
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ /gtranslate/translate.php?lang=$1 [L,QSA]

Even using RewriteCond %{REQUEST_URI} !^/js/ the views UI module is not completely unusable, the admin_menu is blocked because it is doing an ajax request to get the cache on this path /admin_menu/cache/{hash}

So give a proper solution by htaccess to be drupal compatible or remove it from your compatibility list please.
showlib
 
Posts: 25
Joined: Fri Dec 20, 2013 2:39 pm

Re: Ajax request compatibility on drupal site V7

Postby showlib » Mon Jan 27, 2014 11:19 am

So i found a fix to avoid ajax request to use gtranslate so we could have admin UI working. If it is ok, and don't think it will affect your closed source code, don't be a snob and add it to your documentation, so later users will not loose the time i did.

Code: Select all
  #gtranslate
  RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)/(.*)$ /$1/$3 [R=301,L]
  RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)$ /$1/ [R=301,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_URI} !^/js/
  RewriteCond %{HTTP:X-Requested-With} !=XMLHttpRequest
  RewriteCond %{HTTP:X-REQUESTED-WITH} !^(XMLHttpRequest)$
  RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA]
  RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ /gtranslate/translate.php?lang=$1 [L,QSA]
showlib
 
Posts: 25
Joined: Fri Dec 20, 2013 2:39 pm


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest

2GLux
cron