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:
- First check what the user is telling you about their likely choice. The easiest ways are:
- Parse the language/culture information out of the HTTP user agent string (examples for Firefox). This tells you something about the OS version they're running, and is a very good indication of preference. They may of course be spoofing user agents, but if they are doing that they're less likely to be surprised they're getting wrong pre-sets.
- The Accept-Language HTTP header (lower priority, as you're likely to see more "en" here than actual users with English as the OS preference).
- Second, save the user's preference. If they log in, ask them and save it as an option. If not, set a cookie (with a reasonable expiry setting). This way, they will be pleasantly surprised when they come back.
- Use GeoIP only as the last resort.