Where to store selected language on multilingual site: session/cookies or url?
Posted
by tig
on Stack Overflow
See other posts from Stack Overflow
or by tig
Published on 2010-05-05T15:51:38Z
Indexed on
2010/05/05
15:58 UTC
Read the original article
Hit count: 292
I have a site that has all its content translated to multiple languages and has no accounts (to set prefered language there). I can detect preferred language using Accept-Language, ip or anything else. I have 3 ways to store user language selection:
- Detect language and store it in cookie/session and allow switching language (and also store it in cookie/session)
- Use detected language if there is no language specified in url, and show links to url with different language
- Use default site language and show links to other languages
Storing langage in url can be of any type: different domain, subdomain, or somewhere in url
I think about first case as it allows me to send one url to anyone and it will be presented to them in their preferred language. But another opinion is that different language means different data, so it must have different link.
© Stack Overflow or respective owner