When you build the <head> for a multilingual site and already have one region variable in your config, it's tempting to drop it in everywhere and move on. Immediately, you hit a snag. Put en_GB in <html lang> and you break HTML validation and confuse screen-reader voice profiles. Put en-GB in og:locale and you violate the social preview spec. So you end up keeping two variables or swapping the separator on the fly.
<!-- Document language per BCP 47: hyphen only -->
<html lang="en-GB">
<head>
<!-- Open Graph locale in POSIX format: underscore only -->
<meta property="og:locale" content="en_GB">
</head>
It looks like an annoying inconsistency, yet it's simply two different standards colliding inside one HTML file.
How Hyphens and Underscores Ended Up in the Same Document
The lang attribute is governed by section 3.2.6.2 of the WHATWG HTML Living Standard. It declares the primary language of an element's text and attributes, and requires a valid BCP 47 language tag.
BCP 47 is the IETF rulebook for identifying languages on the web, anchored by RFC 5646 (September 2009) alongside RFC 4647 for tag matching. Section 6 of RFC 4647 strictly defines the allowed characters: ASCII letters A-Z and a-z, digits 0-9, and the hyphen (HYPHEN-MINUS, %x2D). Underscores aren't allowed at all. Both the Accept-Language header and JavaScript's Intl API follow the same rules: en means English broadly, en-GB specifies British English, and en-CA specifies Canadian English.
Now look at the Open Graph Protocol. For og:locale, it specifies language_TERRITORY, defaulting to en_US. The protocol has little public discussion history—the facebook/open-graph-protocol repo sat untouched for years before reopening for the payment property—but its roots show up in Facebook's platform docs. The same underscore format still appears in Facebook Embedded Posts SDK URLs like connect.facebook.net/fr_FR/sdk.js. Facebook borrowed it from POSIX locales (ISO/IEC 15897), familiar from LANG and LC_ALL on Linux or older PHP with gettext.
Language and Locale Are Not the Same Thing
The clue sits right in the attribute names. lang tells the browser one thing: what language the text is written in. It says nothing about currency or sorting.
A locale, in POSIX and IBM AIX terminology, bundles language, territory, and regional conventions: sorting order, case rules, date formats, currency, and number separators. Quick test: is 10/08/12 August 10 or October 8? Is 5.99 dollars, pounds, or yen? Knowing "English" isn't enough because British and American readers interpret those strings differently. A locale removes that ambiguity.
Open Graph adds one more wrinkle: og:locale describes the language of the preview metadata tags themselves, not the whole HTML page. Technically, you can serve a page in Japanese, write its social preview card in another language, and list translations via og:locale:alternate.
Do We Still Need og:locale, and How Does lang Work on meta Tags?
Does Open Graph's locale actually do anything useful today? Looking at the data types on ogp.me paints a funny picture. Dates are strictly ISO 8601 (like 2026-12-01). Booleans, strings, and enums don't depend on regional settings either. Even the newer payment block doesn't guess currency from a country—it uses a dedicated payment:currency field with an ISO 4217 code (GBP, EUR, USD).
That leaves just one tiny edge case where a locale could matter: thousand and decimal separators (5,99 vs. 5.99 or 10.000,32). Meanwhile, HTML has long had a built-in way to tag metadata language. You can put the global lang attribute on any element, including <meta>, and even mix languages across adjacent tags:
<!-- Site name in French -->
<meta property="og:site_name" content="Les Misérables" lang="fr">
<!-- Description in British English -->
<meta property="og:description"
content="A book by Victor Hugo."
lang="en-GB">
Under the HTML standard, this markup is completely valid and parses cleanly—French for the site name, British English for the description, with no separate og:locale needed.
Still, it's too early to delete og:locale in production. Social and messenger scrapers (Meta, Telegram, X, LinkedIn) have expected underscored language_TERRITORY tags for years and usually ignore lang on <meta>. For reliable previews, keep one simple rule in your templates: use a BCP 47 hyphen in <html lang> and browser APIs, and swap to an underscore at the Open Graph boundary.




