BCP-47 OpenGraph locale codes (en_GB, sv_SE, …) for
the 14 supported languages, plus helpers to emit the canonical
og:locale and 13 og:locale:alternate meta tags on every page.
Why this matters. OpenGraph (Facebook, LinkedIn, Slack, Discord)
and Twitter/X expect og:locale to follow the BCP-47 underscore
form (language_TERRITORY). The ISO 639-1 bare code (en, sv)
that the rest of the site uses internally is accepted by Google's
inLanguage schema but breaks social-card locale routing — Facebook
silently falls back to en_US and serves the English preview to
Swedish/German/Arabic users.
Choice of region tag. Where a language has an obvious primary EU
jurisdiction we use it (sv_SE, de_DE, fr_FR, es_ES, nl_NL).
For Arabic, Hebrew, Japanese, Korean, Chinese, Norwegian, Danish,
Finnish we pick the canonical CLDR/ISO 3166 region. English is
en_GB (not en_US) — the editorial voice targets EU readers.
The mapping table is the single source of truth for the social-
card surface and is consumed by every HTML generator in
src/generators/ plus src/aggregator/article-html.ts. Tests
assert byte-equivalent output across the four surfaces.
Description
BCP-47 OpenGraph locale codes (
en_GB,sv_SE, …) for the 14 supported languages, plus helpers to emit the canonicalog:localeand 13og:locale:alternatemeta tags on every page.Why this matters. OpenGraph (Facebook, LinkedIn, Slack, Discord) and Twitter/X expect
og:localeto follow the BCP-47 underscore form (language_TERRITORY). The ISO 639-1 bare code (en,sv) that the rest of the site uses internally is accepted by Google'sinLanguageschema but breaks social-card locale routing — Facebook silently falls back toen_USand serves the English preview to Swedish/German/Arabic users.Choice of region tag. Where a language has an obvious primary EU jurisdiction we use it (
sv_SE,de_DE,fr_FR,es_ES,nl_NL). For Arabic, Hebrew, Japanese, Korean, Chinese, Norwegian, Danish, Finnish we pick the canonical CLDR/ISO 3166 region. English isen_GB(noten_US) — the editorial voice targets EU readers.The mapping table is the single source of truth for the social- card surface and is consumed by every HTML generator in
src/generators/plussrc/aggregator/article-html.ts. Tests assert byte-equivalent output across the four surfaces.