$_GET['glang'] is null or empty on Wordpress PRO version

Popular automatic website translation tool

$_GET['glang'] is null or empty on Wordpress PRO version

Postby Salmy » Mon Jul 07, 2014 7:53 pm

I think nobody else has faced this problem, and it's a very big problem for me since I need to translate the jquery datepicker in different languages.

It's doing the translations fine when going to /en/ or /fr/, but for some reason php can't seem to detect the variable $_GET['glang'] well to detect in which language it's displaying the page. Whenever I echo it it comes blank.

Any alternatives? It's currently working under Wordpress 3.9.1. Is there any other variable to see? Thank you!
Salmy
 
Posts: 5
Joined: Mon May 19, 2014 9:38 pm

Re: $_GET['glang'] is null or empty on Wordpress PRO version

Postby Edvard » Mon Jul 07, 2014 7:56 pm

Hi,

In order to enable that parameter you need to use this rewrite rules in your .htaccess:

# gtranslate config
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
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&glang=$1&url=$2 [L,QSA]
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ /gtranslate/translate.php?lang=$1&glang=$1 [L,QSA]

The parameter will be set when the language is selected other than your original. If it is not set, then you may consider it to be your default language.

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: 4186
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: $_GET['glang'] is null or empty on Wordpress PRO version

Postby Salmy » Mon Jul 07, 2014 9:57 pm

OK, I followed the instructions, and it didn't include the glang variable in the rewriterules. Makes sense. Now it works, thank you!
Salmy
 
Posts: 5
Joined: Mon May 19, 2014 9:38 pm

Re: $_GET['glang'] is null or empty on Wordpress PRO version

Postby Edvard » Tue Jul 08, 2014 12:08 am

You are welcome.

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: 4186
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

2GLux
cron