Cookies vs Language Detection (Browser vs Location) vs None of both in multilingual websites
I have a dilemma with the following scenarios:
Dilemma No.1
Cookies:
Its good for users who access the website from his/her personal computer (no need to select preferred language again), but what happens if a language was fist selected in a public PC (e.g library) by someone, then it doesn't make too much sense because someone else with another language preferences may come.
Dilemma No.2
Language Detection:
If the webpage detects the language from the location. What happen with the foreigners living in that country? (Is it more probable that the foreigners living in a country use a browser which is set to his/her language?).
(I already have a menu t开发者_StackOverflow中文版o select the language but I think 'automation' is good.)
Which could be the best solution?
My preference:
- if user is registered and have language preference, use that language
- language detection with Accept-Language HTTP header 2.5 (location language detection)
- fallback language (eg: en_US or more adapted to your targeted public)
I'm not sure language detection by location is a really good idea, for now, most device sharing location are mobile device which may meant the user is traveling. There is also foreigner as you said. And in my case, I'm french, living in France and yet have browser preference to en_US.
What's wrong with both? Use cookies to determine the first choice of language. Have a subtle option (perhaps with a graphic such as a flag) presented to change the option to the locations/browser's language in case the wrong one is chosen.
Language negotiation is a good choice for when a new user visits the website the first time.
But I would also make the language selection as easy and transparent as possible by putting the language identifier into the URL like /en/…
. With such a URL the selected language is transparent to the user and can be changed if needed. Together with this language specific URL I would also provide a language independent URL without the language identifier.
if we have the following ingredients:
- cookie
- ip location
- language detection
- language choice screen
- available languages for site
then I (living in a 3-lingual country with english very much the 4th language) would like my language served the following way:
- if cookie with lang: show cookieLang
if no cookie:
- IPloc = result IP location
- detLang= result of language negotation
- if (match (e.g. IPloc=BE & detLang=FR) & language available), then set cookie & show detectedLang
- else (eg. no match IPloc=IT & detLang=NL) then show language choice screen, have user make choice, set lang in cookie & show choosen language
a lot of sites here (belgium) just show the language choice screen and that is considered an error-prone & simple solution.
an alternative could be to register 2 (or more) URL's, e.g. mybank.be, mijnbank.be & monbanque.be, all pointing to the same site. depending on the URL the user chooses, the correct language is auto-selected.
精彩评论