logoalt Hacker News

numpad0 • today at 8:05 AM • 3 replies • view on HN

> A language only tells you about the language. A locale, by contrast, tells you about the user's preferences.

I think it's more like, it just so happens that choosing language resources based on this pair of parameters is useful, because neither of these are particularly good boundaries.

There are people like Spanish speakers in the US, German speakers in Switzerland, Portuguese speakers in Brazil, things like that. So either of languages or flags alone is not enough, but combinations of both works 99% of the time. So that gets used.


Replies

PennRobotics • today at 9:12 AM

I was raised in the US and work in Germany, but I set my region to Ireland because, as you say, it represents my preferences and daily work best.

If I set my locale to en_US, I get Letter-size paper and USD and MM/DD/YYYY as defaults---all different from what I use every day.

Setting de_DE means writing "a million and change" as 1.000.000,69 which sometimes causes problems copying data from one window to another but mostly confuses me.

An Irish locale gives me preferred formats for numbers, dates, currency, language, and print defaults.

➕ show 3 replies
rafabulsing • today at 2:51 PM

> There are people like [...] Portuguese speakers in Brazil

There sure are. 200 million of them, in fact :)

Theodores • today at 1:17 PM

The author is English, and the 'discovery' that 'locale' is not the same as 'lang' is a bit of an 'aha' moment because we aren't like you, in having a clearly different language to the default 'Simplified American English' (as we say, snarkily, in the UK, out of earshot of those noisy 'mericans).

In the UK, setting the computer to whatever the UK should be is handled by a nice drop-down at installation time, shielding us from ever knowing whether it is en-GB or en_GB. Everything works after that, albeit with some fuzziness with Wikipedia and Google Translate, where English is a mix of OG and Simplified.

The quirks are not catastrophic, it is not as if we get a foreign language if the settings are off. You can have an office worker use en-US settings for years without them knowing any better.

Anyway, now I know that locale is to be confused with lang, with the chances of me remembering whether it is a dash or an underscore that I need, time to give the SVG 'switch' statement a go. This can make an SVG locale (or is it lang?) specific, unlike anything in standard HTML/CSS. However, it does nae work, for me, and this could be because I am using underscore rather than minus, or vice-versa. This would also mean the examples on MDN are also wrong, because they don't work in modern browsers.