I'm working on a web site that has some minor internationalization needs (English, French and German), and I want to figure out where the user is coming from so I know which to display. I think the right way to do this is to check the "HTTP_ACCEPT_LANGUAGE" header to find out the #1 language the user is requesting (and it's safe to assume that all users in Germany have browsers that default to asking for DE, etc.).
Is that correct? Or do I have do something else (hopefully nothing too ridiculous, like trying to figure out their country from their IP)...?
thanks-- Eric
If you go for the currently most popular choice -- geoIP -- without further consideration, you're not doing your users a great favour.
Languages and countries do not overlap. What are you going to do with users from Swiss IP addresses? Belgium? Canada? If you go for the majority language in each case, you'll annoy repeat visitors who happen to be part of large linguistic minorities: they'll be greeted in the "wrong" language each and every time, even though the site is available in their preferred language. The same is true for expats -- and from experience, it is extremely disconcerting to be greeted in, say, Swedish just because I happen to travel to Sweden. (And even big sites get it wrong. The other day I arrived at Vancouver airport from London and Google switched me to fr_CA.) Don't forget that a large number of people are multilingual or non-native speakers of majority language of their country of residence.
Here are the guidlines I follow:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With