Forum Archive - Ajax request compatibility on drupal site V7

Ajax request compatibility on drupal site V7
Jan 24, 2014 3:47 pm by showlib
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
Re: Ajax request compatibility on drupal site V7
Jan 24, 2014 9:26 pm by Yana
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?
Re: Ajax request compatibility on drupal site V7
Jan 24, 2014 11:01 pm by showlib
Ok, i've sent you the access. Thanks you
Re: Ajax request compatibility on drupal site V7
Jan 25, 2014 11:18 am by Yana
Thank you. I'll check you ASAP.
Re: Ajax request compatibility on drupal site V7
Jan 25, 2014 12:51 pm by showlib
Ok Our Developments are quite impacted by this ! Don't Forget us please... Regards
Re: Ajax request compatibility on drupal site V7
Jan 26, 2014 1:45 am by showlib
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
Re: Ajax request compatibility on drupal site V7
Jan 26, 2014 12:40 pm by Yana
Hi, Please try to add class="notranslate" to the wrapper element.
Re: Ajax request compatibility on drupal site V7
Jan 27, 2014 6:47 am by showlib
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.
Re: Ajax request compatibility on drupal site V7
Jan 27, 2014 7:19 am by showlib
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. #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]

SIMILAR TOPICS

how to translate site right to left for arabic in WordPressDec 26, 2018 9:02 amReplies: 1Post by: Hammond753
How do I add Indian languages in Drupal GTranslate?Sep 18, 2011 6:10 amReplies: 26Post by: rag_gupta
Would you share your site URL?Dec 3, 2018 4:57 pmReplies: 1Post by: BevVincent
AJAX requests sent to wrong (with language code) URLSep 27, 2018 10:16 amReplies: 3Post by: atriaforever
Can I Translate Only Few Elements Of My Site?Aug 16, 2018 1:31 pmReplies: 1Post by: riyagupta

Try GTranslate with a free 15 day trial