Changing languages

filthlab
Posts: 118
Joined: Tue May 30, 2017 6:49 am

Changing languages

Post by filthlab »

Hi,
I had a problem with changing languages - when I have changed the language I were always redirected to the main page rather then staying on the current page.
Like you suggested I have fixed this with: http://domain.com/de/$_SERVER['REQUEST_URI']
But now I have another problem - if I change the language for the second time I'm getting an url, like this:
http://domain.com/es/de/category/amateur/. And if I change the language for the third time, the url is: http://domain.com/it/es/de/category/amateur/

How can I fix this?
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: Changing languages

Post by admin »

Lat's say you edit template content_list

so you have a link

/category/<!--CATEGORY_NAME-->/

for links to other languages just link to

/es/category/<!--CATEGORY_NAME-->/
/de/category/<!--CATEGORY_NAME-->/

and so on
Don't forget to run script update
filthlab
Posts: 118
Joined: Tue May 30, 2017 6:49 am

Re: Changing languages

Post by filthlab »

There is no problem with the linking.
Just visit http://filthlab.com/, change the language several times (not just once) and check the address bar to see what I mean.
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: Changing languages

Post by admin »

Did it - look ok
Can you please explain what's wrong ?
Don't forget to run script update
filthlab
Posts: 118
Joined: Tue May 30, 2017 6:49 am

Re: Changing languages

Post by filthlab »

After several changes of the language, I'm getting the next url in the address bar:
http://filthlab.com/sv/pt/no/it/es/cs/
See the attached file, please.
Attachments
address_bar.jpg
address_bar.jpg (203.67 KiB) Viewed 5027 times
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: Changing languages

Post by admin »

How do you form url in template ?
Don't forget to run script update
filthlab
Posts: 118
Joined: Tue May 30, 2017 6:49 am

Re: Changing languages

Post by filthlab »

<li id="lan-cs"><a href="/cs<?=$_SERVER['REQUEST_URI']?>">Čeština</a></li>
<li id="lan-da"><a href="/da<?=$_SERVER['REQUEST_URI']?>">Dansk</a></li>
<li id="lan-de"><a href="/de<?=$_SERVER['REQUEST_URI']?>">Deutsche</a></li>
<li id="lan-en"><a href="<?=$_SERVER['REQUEST_URI']?>">English</a></li>

and so on
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: Changing languages

Post by admin »

Did you read the second message in this thread ?
Don't forget to run script update
filthlab
Posts: 118
Joined: Tue May 30, 2017 6:49 am

Re: Changing languages

Post by filthlab »

Of course I did.
But the problem is not in links for categories, or pagination. I think the problem is in the links I'm changing the language with.
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: Changing languages

Post by admin »

hm... I said to make likes like

/de/category/<!--CATEGORY_NAME-->/

you say you have links like

<li id="lan-cs"><a href="/cs<?=$_SERVER['REQUEST_URI']?>">Čeština</a></li>

and at the same time insist that you've changed links ...

Looks like I don't understand something ..
Don't forget to run script update
Post Reply