views:

494

answers:

9

I’ve chosen to take this as a question in its own right since it was generating so much debate in the comments of the original post.

It’s interesting to see that a lot of people on SO (who are developer's) just don't get localization. Here’s my take on how it should work:

In all browsers that I've looked at (and for the .NET developers out there too) when you look at a user's culture preferences it is in the following format: language-Culture.

So we have:

  • en-GB - English language - UK culture
  • en-US - English language - US culture
  • en - English language - Invariant culture.
  • fr-FR – French language – French culture
  • fr-CH – French language – Swiss culture
  • de-CH – German language – Swiss culture
  • de-DE – German language – German culture

See MSDN for a complete list that the .NET framework supports.

When I go to a website it knows that I want the English language from the en part and it knows I’m interested in it being slanted to the UK (number formatting, date formatting). So when I go to google.com and it takes me to google.de (because of my IP address) that’s completely fine if google.de displays everything to me in English but completely wrong since google.de is in German. I have little control over my IP address but complete control over my language and culture settings. If you’re interested Microsoft’s new search engine (bing.com) handles things properly. Let's hope Microsoft can learn how to do search as well as Google or Google can learn to localize as well as Microsoft ;)

MSDN has another good article here for more information

So what are your recommendations for how sites should deal with localizations?

+1  A: 

I risk being considered impolite, but I think my post on this topic will have more informative answers, mostly because my post is really a question. I am sorry though that I did not find that post before.

ilya n.
A: 

There's a difference between smart defaults and the ability of users to override them. In big apps I've worked on, I've assumed the user's locale from browser settings, geolocation, etc. -- but always given users a way to easily switch.

I don't know how else one would do that. Not giving users a chance to correct your assumptions is deeply problematic, because you're going to get it wrong some of the time.

ADDITION:

I think your problem here is that while you can edit your locale settings, if they look basically identical to the default, there's no way for an application developer to tell if you left it as-is intentionally, or because you don't know how or why to change it.

I suggest honoring users' localization settings, except if the setting is the overwhelming default, which users may not change. For example, I believe the great majority (90+%) of users with an en-us setting geolocated in Vietnam would almost always be better served by seeing Vietnamese content, rather than US English content, as long as there's a trivial way to switch locales. On the flip side, if a user geolocated in the US has a Vietnamese setting, by all means give him or her Vietnamese content.

Is this irritating for US-English users in Vietnam? Sure. But it's also the greatest good for the greatest number, and helps ensure that average non-technical users get the best real-world experience. Until we can hold a gun to users' heads and force them to honestly declare their language/culture preferences before turning on a computer, we're going to need heuristics like this.

Anirvan
Providing user's with an easy mechanism to change things is definitely the right thing to do, my problem is basing the initial assumption on the one thing I don't have control of: my ip address.
Mark
You're right -- added some more text addressing this in my answer.
Anirvan
A better solution, then, would be to have a null default setting in the browser, which immediately eliminates the issue of distinguishing between "en-us because I set it" and "en-us because I don't know it's configurable". Your suggestion of "everyone else in the world can choose a language preference, but, if you speak English and ever leave the US, you've just got to suck it up because your language happens to be the most common default setting" doesn't strike me as a particularly good one.
Dave Sherohman
@Dave, I agree that would be ideal. But short of going back in time and making browser makers do the right thing, we have to work with the browser environment that's out there.
Anirvan
+2  A: 

I agree, give the user the chance to override them with user preferences in your app. This is especially handy for things like timezone localization issues which you can't derive from browser settings.

Drew Freyling
+3  A: 

At one point in my career, I maintained parts of TCP/IP stack. That puts me in the somewhat rare position of knowing very well that IP addresses should not be used as anything other than Network-layer addresses. Any association between an IP address and a location is all but coincidental - it's an artifact of the way addresses are distributed, not any fundamental part of what an IP address means.

(They're also not useful as the unique identifier of a computer, but that's a different story)

I suggest leaving geolocation out of it. The HTTP standard includes a way for a browser or other user agent to include the users culture preferences with each request (and remember, it's a list of weighted preferences, not necessarily just one culture). Since the browser is closer to the user than you are, you should honor this request, at least as the default.

It's ok to then permit the user to change their preference for your site, either temporarily or permanently. It's even ok to allow the user to choose to view different content with different culture settings. A wild example would be a site that includes both political news and technical information. It's quite reasonable that someone would want the news in their "natural" language, but the technical information in English.

Finally, it's ok to have a fallback pattern. If, for instance, you have a site that services users based on their region (resellers, for instance), then it's possible that Japanese content only exists on your Asian regional sub-site. A Japanese-speaking user visiting your EMEA site might just be stuck seeing English content, which might very well be his last choice.

John Saunders
There are whole companies and databases dedicated to geolocating IP addresses. They're really pretty accurate.
Zan Lynx
+10  A: 

The solution here is so simple, it's annoying that dev's do anything else.

  1. Respect the browser setting. If it says English then by god it's English.

  2. If you absolutely must, then simply add a button at the top to pick something else. Then, and ONLY then, do you override the browser.

  3. If you think your way is better. Stop, have someone slap you. It's not. Repeat as necessary.

  4. Get rid of those web splash pages that ask for someone's country. I have yet to run into a site where it actually matters. Just show your normal page, based off of the browser defaults, and see item 2 above.

  5. IF you happen to have a site that really is served by multiple servers across multiple countries, then you can probably detect which one of your servers is really closer to serve from. If you can't, just stop the redirecting madness and then don't try and make a determination for them.

Chris Lively
A lot of people aren't as conscientious as you or me when it comes to locale settings. They might be using a browser with the default en_US locale even though they're British, Swiss, Croat, Zulu, etc. If you rely on a browser's advertised locale, you will be talking to a lot of people in the wrong language.The underlying problem is that browsers have default locales, or locales that are set by some well-meaning sysadmin. If browsers only advertised a preference when the user had positively expressed one, we'd have a lot less trouble.
Tom Anderson
@twic: I agree, which is why I put in #2. I don't have any feeling for the numbers of people that have incorrect settings. However, if we treat it as the default and give the end user the option to override then we solve all of the issues.
Chris Lively
A: 

I have seen enough forceful bug reports from customers that when investigated turn out to be that one of there users had the browser's culture setting wrong, that we now let the customer override the browsers with a config setting. The browser's culture setting is wrong often enough that is it not very useful, it is also too hard for most end users to find or change it.

Ian Ringrose
Its fine to let users override their settings but its just plain wrong to ignore the settings or second guess them. Otherwise you're just punishing the people who know what they're doing for the ignorance of others.
Mark
Sorry users do not pay for software, customers do.... Stopping one phone call from a user that does not know that they are doing is of more value to a lot of customers then not punishing there power user (that can sort themselves out anyway)
Ian Ringrose
Sorry, but what's the point of having a standards-defined, user-configurable language setting in HTTP if it should (according to you) just be completely ignored anyhow? Perhaps the better solution would be to make it easier to find in the browser, hmm? Maybe even ask the user on installation/first startup what their preferred language is? There are ways to get the average user to be able to set it and solve the issue for *everyone* instead of saying, "Let's take away everyone's ability to choose a default language because some don't know how."
Dave Sherohman
+3  A: 

If localization settings are available - including, but not limited to, the HTTP Accept-Language header - then websites absolutely should respect them.

The common argument against this is that "average users" aren't smart enough to find the language settings and configure them to match their own preferences, so these settings are, more often than not, incorrect (unless the user happens to be within the US).

That is the wrong solution.

If a substantial segment of the user population can't find (or can't be bothered to find) their browser's language settings, then the correct response is to make them easier to find, not for sites to ignore what they've been set to. Perhaps make language settings directly accessible from the program's top level menu instead of burying it inside an over-complicated "Preferences" dialog. Perhaps ask for language preferences the first time the program is run. Perhaps use the operating system's localization settings. Or maybe something completely different, if that's what it takes to make it near-certain that the browser will be sending correct information about the user's preferences. But don't just throw up your hands, say "it's useless and can't be fixed!", and ignore it.

Other answers have talked about letting the user choose a language or locale in their profile on the site, which is also important and absolutely should be standard, but that's just to provide a site-specific override to the user's normal settings. If the user has not overriden this on the site, though, the correct action is to default to the most-preferred available language/locale as specified in their browser settings, not to base it on geolocation of their IP address.

Dave Sherohman
But since they currently *are* wrong a lot of the time, it's irresponsible rely on them! In five years, when browsers have sorted out their locale-selection UI, maybe the situation will be different. But right now, that's the way it is. Pain in the arse, but it is.
Tom Anderson
Penalizing people who do things correctly is *never* the right answer as it serves to discourage them from doing them correctly in the future. As an expat American living in Sweden, what is my incentive to properly set my language preference to en/us if sites are just going to say "your IP address is in Sweden, so we'll ignore your preference setting and give you Swedish anyhow"?
Dave Sherohman
+3  A: 

On the sites I create I usually follow this pattern:

  • Each page has a unique URL with the language in it somewhere, usually like /en/page or a different (sub)domain
  • If the user opens a URL with an unspecified language like /page I start to guess:
    • Is a cookie from a previous session is available?
    • If not, is Accept-Language available and can I map it to a language available on the site?
    • If not, if it's a possibility, can I guess by IP?
    • If not, default to the site's default language.
  • I set a cookie with the guessed language and redirect the user to a site with the appropriate URL
  • I put a language switch on every page, so /en/page can easily be switched to /xx/page
    • Cookie gets updated if the user switches to a different page

Ideally I only have to guess once and from then on use the user's cookie, or the user visits the desired page directly.

deceze
The approach we're taking is to have different domain names for each country, so there's no ambiguity. You arrive on deceze.fr, you get French. You arrive on deceze.ch, you get German, but there are prominent buttons to switch to French or Italian.
Tom Anderson
+2  A: 

I completely agree with you. Most of the sites do it wrong.

IP-geolocation seems to be in fashion so every next site gets to use it. However user location is a very bad information source as to which language and culture the user prefers. Browser culture settings are completely ignored my most of the sites.

I've just written about this problem:

Invasive localization is a usability nightmare (YouTube, Amazon)

Developer Art