views:

1343

answers:

8

Hello!

For a website we're about to implement automatic country/language selection, but still giving the user the choice to change it.

First of all, if the user enters the website using a domain with a country-level TLD they will be presented the correct language by default. But the question is what should the logic be if they come from generic/international TLD such as .com. Should we prefer using the country we get through their IP address or should we use their browser locale? If both, in which sequence?

As such, I was thinking of this hierarchy:

  1. Use User selection if it was changed before. If it has never been set explicitly by the user:
  2. Use hostname TLD. If it is generic (.com):
  3. Use browser locale. If no locale set or no corresponding language version is available for this locale:
  4. Use IP address. If no corresponding language version is available for the detected country:
  5. Use English.

Thanks!

+13  A: 

I would suggest the browser locale rather than the IP address, as one may live elsewhere but prefer a language other than the standard one for that country.

Sev
+1 You have no idea how many times I get served japanese pages.... just because I live here. locale (and even defined preferences on many sites) seems to mean nothing to far too many sites
Jonathan Fingland
+7  A: 

Browser locale as it is the user choice. When a french man is traveling to England with his laptop, he wants browser locale to be respected not IP.

François
+3  A: 

As most countries have several official languages you should rely first on user preferences and then on browser locale, TLD, IP and then english as 'default' (or any major language of your main user base)

HeDinges
So you're saying the browser locale should be used first, before the TLD?What if you've set your browser locale to English but enter the website through the .de TLD?
That's why I wouldn't try to second guess the user. Just present them with a language selection page and set a cookie.
ChrisF
But entering a country TLD is even more specific than setting a browser locale, don't you think? Because the user would explicitly define a country for this website as opposed to the general locale set for their browser.
@Tharuka, because the TLD gives no information about the user language, for example '.be' but i could be french, dutch or german speaking.
HeDinges
Good point, thank you!
+2  A: 

browser locale should be before ip address,

I'm a native english speaker living abroad, I get annoyed with websites that automatically give me my resident countries language when my browser locale is set to english.

tsidwick
A: 

Personally I'd simply go with your primary audience's language on the landing page which is just a language selection page and the user has to select a language to proceed. That sets a cookie so that next time the user visits (from the same browser on the same machine) it redirects the correct language site.

I have several reasons for this.

  1. It's easier to code - no checking IP ranges or browser locale etc. Less code means there's less to go wrong.
  2. You're not assuming anything about the user. They might be an American using a machine set to German in Japan for example.
  3. It's likely to be correct :)
ChrisF
We can't simply go with English as our primary target audience speaks German.The frontpage of the website has a country selector. It's about which language to present by default. The user is always able to override the setting by placing an explicit selection.
Go with German on the homepage if that's your primary audience - I can't see a problem with that.
ChrisF
A: 

IP address matching would require an (expensive) geo/ip lookup database, a commitment and infrastructure to maintain that, has significant problems with block IPs, and ultimately doesn't even give you the information you want because there isn't a 1:1 relationship between country and language (officially: Canada, or unofficially: United States), not even close.

I prefer cookie preference degrading to TLD/subdomain (or local settings where TLD is language agnostic).

annakata
Can you explain why you'd want locale setting respected before TLD? You have explicitly entered the TLD, right?
D'you know what - just asking me that has made me change my mind. I think you're right entering the TLD is the more active choice.
annakata
A: 

You also have to allow for people coming in through web proxies not being in the locale their apparent IP address is.

I get a lot of adverts for San Diego based businesses even though I'm in New Zealand, because I use a web proxy there.

Colin Coghill
A: 

Listen folks, I am not sure where you guys are at, I reside in Finland at the moment, and let me tell you, ONE OF THE MOST FRUSTRATING THINGS MUST BE when the IP address is used to choose the language. It absolutely messes up everything, I am pulling my hair, especially anything related to Google, in fact, I simply cannot use Blogger at all, so if you have any influence over this, PLEASE!!!!!

I hear you.Same here. Using only IP address is really not good. Google (and other web apps) regularily recognize as coming from the Netherlands even though I'm in Austria, and even though I've set my browser locale to Austria.