Page 1 of 7
Multiple Languages
Posted: Thu Jul 21, 2016 2:04 pm
by happydg
Hello,
Let's say i have a multi niches site with multiple languages and with language auto redirect on.
I go to mydomain.com which redirects to mydomain.com/fr/. Then i click on mydomain.com/ru/ because i want to site in russian.
I have custom categories links setup in common.php and htaccess on the main page for example: /?k=Shemale&y=4:2:430 which redirect to /category/Shemale/.
The problem is if change language to mydomain.com/ru/ and click on mydomain.com/?k=Shemale&y=4:2:430 it goes to mydomain.com/fr/category/Shemale/ instead of mydomain.com/ru/category/Shemale/
1) How to retrieve the current language of the page So i could put this link: /?k=Shemale&y=4:2:430&language=currentlanguage and create a custom link language in common.php ?
Thank you.
Re: Multiple Languages
Posted: Thu Jul 21, 2016 5:38 pm
by admin
What build do you use ?
Re: Multiple Languages
Posted: Thu Jul 21, 2016 6:16 pm
by happydg
Latest Build 201603221213 (Lastest build: 201603221213
Re: Multiple Languages
Posted: Mon Jul 25, 2016 11:09 am
by admin
Sorry for the late answer.
The easiest way is to add <?=$_GET['force_lng']?> variable to your links
Re: Multiple Languages
Posted: Tue Jul 26, 2016 9:33 am
by happydg
Where should i add this code in a link exactly?
Re: Multiple Languages
Posted: Tue Jul 26, 2016 4:39 pm
by admin
Depends on your rewrites
for example
http://domain/<?=$_GET['force_lng']?>/gallery/<!--GALLERY_SLUG-->/
anyway w\o rewrites it wshould be
out.php?url=content&slug=...&force_lng=... and so on
Re: Multiple Languages
Posted: Sun Jul 31, 2016 11:35 am
by happydg
I added:
Code: Select all
if (isset($_GET['l'])) $_GET['force_lng'] = $_GET['l'];
In common.php, so my link is
Code: Select all
/test/?k=<!--CATEGORY_NAME-->&l=<?=$_GET['force_lng']?>...
but it still redirects to french version when i'm on spanish page.
For example when i'm on
http://www.domain.com/es/ and click on
http://www.domain.com/test/?k=Babe&l=es it goes to
http://www.domain.com/fr/category/Babe/ instead of
http://www.domain.com/es/category/Babe/
I have in htaccess:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]{2})/(.*)$ $2?force_lng=$1&%{QUERY_STRING} [L]
RewriteRule ^test/$ /scj/cgi/out.php?url=content&p=100&%{QUERY_STRING} [L]
What should i add in htaccess to fix it?
Thank you.
Re: Multiple Languages
Posted: Sun Jul 31, 2016 11:38 am
by admin
Does it work as it suppose to w\o rewrites ?
Re: Multiple Languages
Posted: Sun Jul 31, 2016 12:17 pm
by happydg
It works without rewrites:
http://domain.com/scj/cgi/out.php?url=c ... _name=babe
Goes to Spanish version, i can check this by inserting <?=$_GET['force_lng']?> somewhere in content_list.
But if i go to
http://www.domain.com/es/category/babe/ directly, the <?=$_GET['force_lng']?> in the content_list will output "fr" and not "es".
Here are my category url rewrites:
Code: Select all
RewriteRule ^category/([^/]+)/$ /scj/cgi/out.php?link=images/%{QUERY_STRING}&url=content&p=100&skip_to_cookie=true&skip_sell=true&group_name=$1&order=ctr [L]
RewriteRule ^category/([^/]+)/$ /scj/tube/index.php?group_name=$1 [L]
RewriteRule ^category/([^/]+)/([^/]+)/([^/]+)/$ /scj/cgi/out.php?link=images/%{QUERY_STRING}&url=content&p=100&skip_to_cookie=true&skip_sell=true&group_name=$1&order=$2&page=$3 [L]
RewriteCond %{QUERY_STRING} ^(.+)$
RewriteRule ^category/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ /scj/cgi/out.php?link=images/%{QUERY_STRING}&url=content&p=100&skip_to_cookie=true&skip_sell=true&group_id=$1&order=$3&page=$4 [L]
RewriteRule ^category/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ /scj/tube/index.php?group_id=$1&order=$3&page=$4 [L]
Re: Multiple Languages
Posted: Mon Aug 01, 2016 6:34 am
by admin
Then there's a mistake in rewrites
Double сheck it
You can add
print_r($_GET);
into common.php to see what variables actually gets the script.