Turn off Gtranslate on some pages
Feb 3, 2016 1:30 pm by olegthered
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
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
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
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
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
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
Feb 4, 2016 5:47 pm by olegthered
Single cart is what I was thinking about. Sounds good. Emailed you.
SIMILAR TOPICS
Gtranslate Multisite | Feb 12, 2019 7:27 am | Replies: 1 | Post by: infact_dat |
Gtranslate: Error with number | Feb 20, 2019 1:20 am | Replies: 1 | Post by: infact_dat |
GTranslate 3.7.4, Joomla 3.9.3 - doGTranslate is not defined | Feb 22, 2019 12:34 pm | Replies: 1 | Post by: oase |
Add-on gtranslate no longer works | Feb 2, 2019 6:01 am | Replies: 1 | Post by: DarylDixon |
Instragram and Gtranslate...!!!! | Dec 19, 2018 11:18 am | Replies: 1 | Post by: zackfernandes |