Forum Archive - WordPress and Ajax

WordPress and Ajax
Oct 14, 2014 3:25 pm by jdgrimes
Hello, We are using GTranslate Pro on a WordPress site. It is working, but I have a question regarding translating content that is loaded via Ajax requests. This page is an example. The content is translated, but when the search filters are refreshed with an Ajax request, they are not translated. Can GTranslate translate content retrieved using Ajax requests? If not, would it be possible for me to implement that? (I know PHP.)
Re: WordPress and Ajax
Oct 14, 2014 3:30 pm by Edvard
Hi, I just wanted to check your ajax requests and they give me 500 server error. The general rule is if the ajax response is in HTML it will be translated, you just need to make sure that the ajax request goes to the URL with the language code. If the response is in JSON format, it will not be translated, because there is no general rule what to translate inside JSON object to not break it. Thanks!
Re: WordPress and Ajax
Oct 14, 2014 8:00 pm by jdgrimes
Thank you for the explanation. How would I get the language code in the PHP so that I can add it to the Ajax URL? I am not able to reproduce the 500 response for the Ajax requests. :S
Re: WordPress and Ajax
Oct 14, 2014 10:30 pm by Edvard
Please check get-null-empty-wordpress-pro-version-t3731.html to find that out. It still responds with 500 errors for me. Thanks!

SIMILAR TOPICS

wordpress amp link not translateDec 31, 2016 10:11 amReplies: 12Post by: besybuy
Add links to all translated posts on every Wordpress postJan 14, 2019 8:51 pmReplies: 5Post by: ptsniper
Best way to translate a page in WordPress?Jan 7, 2019 11:10 amReplies: 3Post by: Tonnystark
how to translate site right to left for arabic in WordPressDec 26, 2018 9:02 amReplies: 1Post by: Hammond753
G Translate on 2 menus on wordpress (desktop and mobile)Nov 1, 2018 3:33 pmReplies: 1Post by: investatemiami

Try GTranslate with a free 15 day trial