HTML esoterica: en-GB vs en_GB

Author’s photo in a circle surrounded by the words “div”, “role”, “span”, and “table”, the HTMHell logo, and title “HTML esoterica: en-GB vs en_GB”.

Terence Eden opens this year’s HTMHell Advent Calendar with a puzzle: why does the lang attribute use a hyphen, while Open Graph’s og:locale uses an underscore? The lang value is a BCP 47 language tag, and og:locale follows the POSIX locale format. But a language isn’t a locale, which also covers dates, numbers, and currency. As OGP is barely maintained, he suggests replacing og:locale with lang on <meta> elements.

htmhell.dev/adventcalendar/2026/1