Forum Archive - Turn off Gtranslate on some pages

Turn off Gtranslate on some pages
Feb 3, 2016 1:30 pm by olegthered
Hello, is there an option to turn off GTranslate on some pages? And also how can I set language for GTranslate on current page via php?
Re: Turn off Gtranslate on some pages
Feb 4, 2016 3:38 am by Edvard
Hi, You may add class="notranslate" attribute to html tag and the page will not be translated. You may access the language code in PHP using $_SERVER['HTTP_X_GT_LANG'] variable. It will be set for translated pages only and will contain the language code. Thanks!
Re: Turn off Gtranslate on some pages
Feb 4, 2016 9:41 am by olegthered
$_SERVER['HTTP_X_GT_LANG'] is working for me. But class="notranslate" is not. I tried to add it to html, body tags in header.php and got no result, tried to remove shortcode and nothing - page is stil translated (I use Enterprise). So I need it to work: 1 to be on translated page en.tracers.ru/about 2 I click Shop on main nav menu and go to tracers.ru/shop-en 3 When I go to any other site page from tracers.ru/shop-en I should get it translated via GTranslate
Re: Turn off Gtranslate on some pages
Feb 4, 2016 5:26 pm by Edvard
It can be tricky, but it is possible to configure it that way. I just want to know why you do not want to use your shop with GTranslate? Thanks!
Re: Turn off Gtranslate on some pages
Feb 4, 2016 5:38 pm by olegthered
I do. But I can't figure it out how to make cart and checkout form with dynamic price calculation work. I need stable store behaviour because I am going to use my store in at least two languages. Now when I add product to cart (eg tracers.ru/shop/mowgli-flora) I get cart on top of page (it's ok), there I have buttons 'go to cart' and 'checkout' (buttons are still not translated). When I press 'go to cart' or 'checkout' I get page with 'your cart is empty'. If I go manually by typing url http://tracers.ru/checkout/ and choose english lang then I have non translated dynamic form on the right.
Re: Turn off Gtranslate on some pages
Feb 4, 2016 5:43 pm by Edvard
OK. We will fix that by defining how JSON should be translated. Also, we will set a cookie domain to *.tracers.ru, so your cart will be shared between tracers.ru and en.tracers.ru. You can check how to do that here: https://codex.wordpress.org/Editing_wp- ... kie_Domain
Re: Turn off Gtranslate on some pages
Feb 4, 2016 5:47 pm by olegthered
Single cart is what I was thinking about. Sounds good. Emailed you.

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