Hi,
I am using GTranslate in my site: http://www.investorport.com/index.php
I am suing the following settings in admin Global configration:
SEO Settings
Search Engine Friendly URLs = Yes
Use Apache mod_rewrite = Yes
Add suffix to URLs=Yes
Gtranslate Module Settings:
Operate with GTranslate Pro version = On
Translation method = Redirect
Load jQuery library = On
.htaccess file:
# mod_rewrite in use
RewriteEngine On
# 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&url=$2&force_no_api=1 [L,QSA]
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ /gtranslate/translate.php?lang=$1&force_no_api=1 [L,QSA]
RewriteCond %{HTTP_HOST} ^investorport\.com
RewriteRule ^(.*)$ http://www.investorport.com/$1 [R=permanent,L]
GTranlate config file:
<?php
//define('API_KEY', 'AIzaSyBBQS7gcvU9bKgFoWtSr_8S6fES8gEO9mI'); // You need to get your Google Translate API key from https://code.google.com/apis/console/?api=translate
define('API_KEY', 'AIzaSyBA7y7rUxU9fpAlzztD6DW8WOadnB3RYM4');
define('MAIN_LANG', 'en'); // en, ar, bg, hr, cn, ct, cs, da, et, tl, fi, fr, gl, el, iw, hi, es, nl, id, ja, ca, ko, lt, lv, mt, de, no, pt, ru, ro, sr, sk, sl, sv, th, tr, uk, hu, vi, it, pl, sq
define('CACHE_TIME', 365*24*60*60); // 1 year
define('LICENSE', 'license.dat');
// username and password to edit translations, please change for security reasons
define('USER', 'user');
define('PASS', 'pass');
When I refresh my page and change the language using drop down on home page:
http://www.investorport.com/index.php
Htaccess rules makes URL like: http://www.investorport.com/af/index.php
and an error accour :
Fatal error: Uncaught SoapFault exception: [s:Client] ArgumentOutOfRangeException: 'to' must be a valid language Parameter name: to : ID=3737.V2_Soap.Translate.256F8EC5 in /home/etech/public_html/investorport.com/gtranslate/translate.php:100 Stack trace: #0 /home/etech/public_html/investorport.com/gtranslate/translate.php(100): SoapClient->__call('Translate', Array) #1 /home/etech/public_html/investorport.com/gtranslate/translate.php(165): get_translation() #2 /home/etech/public_html/investorport.com/gtranslate/translate.php(248): gtranslate() #3 /home/etech/public_html/investorport.com/gtranslate/translate.php(465): translate(Array) #4 /home/etech/public_html/investorport.com/gtranslate/translate.php(478): simple_html_dom_node->outertext() #5 /home/etech/public_html/investorport.com/gtranslate/translate.php(478): simple_html_dom_node->outertext() #6 /home/etech/public_html/investorport.com/gtranslate/translate.php(478): simple_html_dom_node->outertext() #7 /home/etech/public_html/investorport.com/gtranslate/translate.ph in /home/etech/public_html/investorport.com/gtranslate/translate.php on line 100
Please help me to short this out and let me know where I am making problem.
Feel free if you have any query related to the implementation or you need more details from me.
Waiting for your kind response. Please respond me as soon as possible.
Rehards,
Max