Turn off Gtranslate on some pages

Popular automatic website translation tool

Turn off Gtranslate on some pages

Postby olegthered » Wed Feb 03, 2016 5:30 pm

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?
olegthered
 
Posts: 79
Joined: Thu Feb 26, 2015 11:52 am

Re: Turn off Gtranslate on some pages

Postby Edvard » Thu Feb 04, 2016 7:38 am

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!
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4185
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Turn off Gtranslate on some pages

Postby olegthered » Thu Feb 04, 2016 1:41 pm

$_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
olegthered
 
Posts: 79
Joined: Thu Feb 26, 2015 11:52 am

Re: Turn off Gtranslate on some pages

Postby Edvard » Thu Feb 04, 2016 9:26 pm

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!
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4185
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Turn off Gtranslate on some pages

Postby olegthered » Thu Feb 04, 2016 9:38 pm

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.
olegthered
 
Posts: 79
Joined: Thu Feb 26, 2015 11:52 am

Re: Turn off Gtranslate on some pages

Postby Edvard » Thu Feb 04, 2016 9:43 pm

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
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4185
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Turn off Gtranslate on some pages

Postby olegthered » Thu Feb 04, 2016 9:47 pm

Single cart is what I was thinking about. Sounds good. Emailed you.
olegthered
 
Posts: 79
Joined: Thu Feb 26, 2015 11:52 am


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

2GLux
cron