Programmering och webbdesign, IT

Just another WordPress.com weblog

Language based on IP-Location or Headers

lämna en kommentar »

Too many major sites rely on your IP-address to make the decision what language their site should present to users. For example both the all-mighty Google and Imdb rely on it! I find this surprising since there actually is a better solution which isn’t even half as complicated!

Practically all browsers provide the users language in the headers when requesting a page. This is the language the user has as language in their browser. Most users install their browser in their preferred language, why should websites question users and force another language?

What’s even more surprising to me is that basing the language on IP-address has a lot of issues while the language in the headers is almost “bullet-proof”. First of all IP locating people is far from 100% correct, IPs keep changing and tables have to be updated constantly. You always risk getting the wrong language. An even bigger problem with the ip-location logic is thinking that all users in Sweden speaks Swedish for example. How does this work for people travelling the world?

So then you might think that there has to be bigger problems with relying on language in the headers? The only problem I’ve found is that not all “web agents” actually send this data. However the agents that don’t send it are mostly bots and not actual users. In this case there is no problem in having the ip-location as a backup solution either!

So get on track and use the data that actually is available to you developers!!

Skrivet av oskarmothander

november 1, 2010 den 3:31 e m

Postat i Uncategorized

Lämna en kommentar

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Logga ut / Ändra )

Twitter-bild

You are commenting using your Twitter account. Logga ut / Ändra )

Facebook-foto

You are commenting using your Facebook account. Logga ut / Ändra )

Ansluter till %s

Follow

Get every new post delivered to your Inbox.