Where to store selected language on multilingual site: session/cookies or url?
- by tig
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.