logoalt Hacker News

HTML esoterica – en-GB vs. en_GB

54 points • by edent • last Tuesday at 7:17 AM • 9 comments • view on HN

Comments

SyzygyRhythm • today at 7:34 AM

The page doesn't seem to quite spell out the answer, which is that lang and locale have nothing to do with each other. It's basically coincidence that they look even similar. The locale came from basically an ad-hoc system from X/Open in the late 80s, while lang comes from RFC 5646 in 2009. The two become more obviously different if you need to specify anything complicated, like sr_RS.UTF-8@latin or zh-cmn-Hans-CN.

numpad0 • today at 8:05 AM

> 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.

➕ show 1 reply
hibbelig • today at 7:22 AM

I don’t unterstand this. In order to write correct text i have to know some conventions, such as number formatting. So just language and locale are kind of hard to separate. Why dies the author say that the locale doesn’t matter for strings in OGP metadata?

sph • today at 6:40 AM

I must say - great domain name.

bentley • today at 7:47 AM

For English content I just use <html lang=en>: quiets the validator, makes no difference in rendering, so simple I don’t even think about it.

nathell • today at 8:33 AM

> a Facebook recommendation is not the same as a living standard.

Sure it’s not. Remember how Facebook used to offer RSS feeds until 2015?

Conformance to standards (let alone development of standards) in the interest of interoperability is against the needs of a digital giant, unless it strengthens their hegemony. It’s a variant of the ‘embrace–extend–extinguish’ tactic. It could be dubbed SSS: Standardize–Support–Subvert.

cobychapple • today at 8:56 AM

In related fuckery… JS Intl throws on the underscore form. `Intl.getCanonicalLocales("EN_US")` is a RangeError, so piping og:locale into a formatter needs a replace first. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

dmitrygr • today at 6:54 AM

> mark, a yen, a buck, or a pound

Nice reference. :)

JimmyAIPPT • today at 8:53 AM

[dead]