2

My current strategy for choosing a language to present a Web page or an app is:

I look at HTTP Accept-Language from the browser, or "Locale Settings" from the phone, then:

  1. If the language is not English, then use this language.
  2. If the language is English, then do a IP to country lookup, then pick the first language listed in the GeoNames country table for the looked-up country.

So a Swiss person with English settings would get "de-CH" (Swiss German), which is the most common language in Switzerland. It's not perfect, but a fair tradeoff for people who don't have proper settings.

The reason for this is that I've come to learn that many people have English as their browser or phone settings, even though they don't have English as their mother tongue. I for myself, have an Operating System in English, but want Web pages in my native, non-English, tongue.

Does anyone have better approaches to this without intricate logic and without user interaction (no dialog boxes asking the user to choose language)?

Edit: I set Accept-Language to English only, and Facebook came up in English (contrary to what I expected). At the same time, the clickable language links at the bottom lists my native language, so it must be IP-based (there is nothing else to base this guess on). Though it also lists several foreign languages not spoken here. Not sure how they assemble this list.

6
  • 1
    There are quite a few questions on this topic here that are probably of some use - this, or this, or this just being a few. Is it a technical implementation you're after, or one that the user themselves choose?
    – JonW
    Sep 3, 2013 at 9:09
  • I would say if you have one language choose that, if you have 2/3 show those as options as a popup on the first screen Sep 3, 2013 at 11:48
  • 3
    So you are going to force my mother tongue on me even when I want English and have set up my browser to make it clear that I prefer English? Sep 3, 2013 at 16:19
  • @MarjanVenema: I seem to remember that Facebook used to do this. But I tried it now (see Edit), and actually they don't. So I stand corrected.
    – forthrin
    Sep 4, 2013 at 19:33
  • 2
    @forthrin: not everything facebook does is worth copying. If they once were or would still be forcing my native language on me, that would be yet another reason for me to avoid Facebook like the plague. :-) Sep 4, 2013 at 20:09

2 Answers 2

2

So if a user in Switzerland speaks French and choose English in his browser you will display information in German. That don't look very optimal. It could be a lot more confusing for Belgium because many citizen don't speak Dutch and French.

I would trust Accept-Language or Local Setting even if it's English. (Some companies who force English operating system let IE/browser have a local accepted language before English.)

Add, with IP to country, the other languages of the country with flags/text/both shortcut. If you do not have so many languages, up to 5, you could display all of them. Otherwise choose ip to country language plus english and other (other could be flag with '?' inside).

0

While this is more code-related and could possibly belong in the Android or iOS stacks, I feel that knowing what is possible (and how those things are possible) are essential to strong UX. So here's a few solutions to set specific language without users having to do anything.

This solution on StackExchange grabs the device's current-set language option. It's also worth checking out this link that was left in the comments of the main answer on that article.

This doesn't use "locale" data, but instead pulls the actual system-setting from the phone. This is an iPhone solution; for Android you could use the stuff listed on this website.

Furthermore, this solution brings together "Locale" data to set a specific region, while pulling system data to set an overall language. This could bring results as fine-grain as discerning between English-US, English-UK, and English-AUS.

All these options failing, there was a contest to create a "language" icon a few years ago. If these options didn't work, or if you want a failsafe setting in case something goes awry, this little icon could open up a language-setting selection dialogue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.