I am currently working on a website which will be international, so it needs to come with different languages.
I have a folder named “lang” with files such as en.php, no.php, and so on.. The files consist of an array with different words.
My question is how i should use this. Should i save the language in the persons computer with cookies? Or should I save the ip adress and assign a language to it and save it in the database, or should i pass a &land=en parameter in the url all over the website?
Any ideas and thoughts about how one should handle multilanguage websites?
Best of regarsds,
Alexander
I think it is probably best to save the user’s language in a cookie, so you do not need to pass it around via a querystring parameter. You may also set it in
$_SESSIONHowever, you should accept alang=parameter in each page, which would allow any user to change language easily and instantly. The new language should then overwrite the existing cookie.