Customizing SMF > SMF Coding Discussion

Change of language from link parameter

(1/1)

xellz:
Wanted to ask, if it's possible to change language from a link parameter. I'm using 2 languages (english and russian), so forum is split in two. Link to forum is from main page which is localized. I want to change language depends on from which language page they came on forum, so it would be easy for them to register.

Arantor:
Sure, if the forum's link is index.php, index.php?language=english or index.php?language=russian

There's also the 'Language Dropdown' mod that's used on this site too.

xellz:
Yes, i want to add Language Button Menu mod. Possibility of directing in right language can also help. Thanks for solution. Expect where does it store data? I could change language like this to russian and back, but then it stopped working. Cleared localhost cookies, but still. Interesting, but not that important :)

Arantor:
Once you click the link, it's retained in the session. Clearing cookies will mean it clears the selection too.

There's no way to set it permanently from a link directly and have it always remember that in the user's profile, at least not without code. Again, I suggest you take a look at the Language Drop Down mod.

xellz:
Thanks, now i understand how it works. Language Button Menu mod feels better, can use flag icons, instead of drop down. Now just need to figure out, how to show those mods in non-default theme. Though this will have to wait until morning.

Navigation

[0] Message Index

Go to full version