How should web sites deal with localization settings? (from “What are common UI misconceptions and annoyances?”)

StackOverflow https://stackoverflow.com/questions/1016709

Question

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?

Was it helpful?

Solution

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. Just show your normal page, based off of the browser defaults, and see item 2 above. I have yet to run into a site where it actually matters. update: a few years later and there is now a reason to do this. In 2013 the UK instituted policies surrounding cookies that website operators need to respect for sites based in that country that are serving pages to visitors from that country. So pay attention to the laws in the countries you are hosted in.

  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.

OTHER TIPS

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.

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.

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.

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.

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.

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top