The audience is a mixture of European and American. What's the standard in this case, Metric or Imperial?

I will allow users to switch.

  • 4
    Ask the user in a simple and polite way, just once. It's nicer to be asked than to have assumptions made. Just don't turn it into a census style survey! Oct 14, 2012 at 12:34
  • @Roger Atrill huh?
    – ditto
    Oct 15, 2012 at 13:02
  • If it's a mixed audience, there's no reliable way to detect the preference from user environment, and the users can switch... then by all means feel free to promote the one system that actually makes some sense! :) Oct 19, 2012 at 13:34

3 Answers 3


If it's a desktop application, then you'll be able to pick up the units settings from the OS. These are set at install time, so require no user interaction, which is perfect.

If it's a webapp you can get the language information from the language-accept header which will generally tell you the country as well as the language. For example language-accept header with en/US would clearly indicate American. I'm not sure whether a Spanish speaking American would show up as es/US, but I imagine they might. So you might want to accept anything ending /US as indicating American. Pretty much anything else would be metric. (The UK is a special case, where the younger generation (<40ish) use metric, but the older use imperial (>50). I'd go with metric unless its a mapping app, in which case I'd go imperial!).

Most of the time these will give you an accurate answer, but occasionally you might find you can't get meaningful information, in which case I'd default either to whichever is the larger fraction of your audience. The logic here is that picking the larger audience you annoy the fewest people.

But if your audiences are roughly the same same size and you have a brand that is heavily associated with either the US or Europe go with whatever is the standard there. The logic here is that Americans will be less surprised to see metres in the interface if they perceive your company as European, and visa versa. Clearly the switch you're adding is important though.

These two fallbacks should not typically be needed though, the locale should be available in almost all cases. If it's a web app you might want to log locales for a while to check that though.

  • The language settings doesn't necessarily imply which set of units the user prefers. OS' do have separate settings for that which the user can change separately. Oct 14, 2012 at 13:29
  • @Danny Quite true, I'll amend the answer accordingly Oct 14, 2012 at 13:36

If this is a webapp, try detecting locale. If a solution for this does not exist, I'd try detecting user location and basing it on that. (Geolocation api)

  • 6
    geolocation seems a little heavy handed for this. Also, it might not be relevant. An american temporarily in Europe would get the wrong settings. Locale is probably more reliable, especially with personal machines (phones/laptops). Oct 14, 2012 at 12:31

If it's a desktop app, Peter is right: grab it from the OS preferences.

However, if it's a webapp, don't depend on language.

Depend on GeoIP solutions instead.

While the Geolocation API would be quite heavyweight and unreliable on a desktop browser, also interrupting user flow ("This application wants to know your location. Allow/Deny?"), GeoIP is fine.

IPs are hopelessly inadequate to get actual location information, but they're assigned on a per-continent basis, so for that it's safe.

As for roaming (US users traveling abroad), iOS maps switches to yards and miles if I go to the UK (even the old style maps). In some cases, this is benefical, as road signs will be in miles, and locals will speak about yards, for me, it's disturbing as I have no solid idea on what a 'yard' means, I'm a continental European.

I'd grab the first setting from IP, store it in a cookie, and if the user changes this setting anytime later, store it in a cookie as well: this way, the unit is felt "persistent", as it is changed only on user request - if a US resident traveling abroad switches to metric, and forgets to switch back to imperial coming home, I guess they'll know the reason.

  • Why do you say don't depend on language? Typically that's obtained from the OS locale settings by the browser. Since you're having to infer unit preferences from location either way I'm not sure why you prefer GeoIP - it seems like a much more complex solution to implement. The language-accept header does generally include country as well as language, so its not just depending entirely on language which would be unwise. Oct 14, 2012 at 15:34
  • 2
    @PeterBagnall: simple. I'm using everything on en-us locale settings as that's what I understand (and the translations are terrible) just like most people in Europe, yet I have absolutely no idea what's the conversion between inches and feets and yards and miles and I don't think I want to know it - viva la revolucion...
    – Aadaam
    Oct 14, 2012 at 18:30
  • Ok, so you set that as your first language? I'm in the UK, so my language setup is en/GB, en/US, en, de/DE since I prefer UK english to US, will accept any English and understand some German (so prefer that to translations). Oct 14, 2012 at 18:48
  • 1
    @PeterBagnall:: yes, exactly, and most people in Eastern Europe who're fluent English (you know, 80s generation and younger) do that, as simply local translations are usually incomplete or incomprehensible.
    – Aadaam
    Oct 14, 2012 at 20:02
  • That's interesting. I should have asked before, are you setting your OS to English, or just the browser. Here many people don't even know about the language settings in their browser so the browser gets its language settings from the OS. Are people more aware of language settings in Europe do you think? Oct 14, 2012 at 20:48

Your Answer

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

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