Skip to content

fix(seo): tell Open Graph the site has seven languages - #196

Merged
chaxus merged 1 commit into
mainfrom
og-locale
Aug 23, 2026
Merged

fix(seo): tell Open Graph the site has seven languages#196
chaxus merged 1 commit into
mainfrom
og-locale

Conversation

@chaxus

@chaxus chaxus commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Second pass over the seven-language site. One real gap, found by diffing what hreflang says against what everything else says.

Open Graph never heard about the translations

hreflang has carried the full seven-language graph since the translations landed. Open Graph was never told — no og:locale, no og:locale:alternate. Every consumer that reads OG rather than hreflang (Facebook, LinkedIn, Slack, most scrapers) treated a share of /ja/ or /pt/ as an English page.

Each page now declares its own og:locale and lists the other six as og:locale:alternate, built from the same set hreflang uses so the two cannot drift apart. The mapping lives in LOCALES, because OG wants language_TERRITORY rather than BCP 47:

en_US · zh_CN · ja_JP · de_DE · es_ES · ko_KR · pt_BR

That last one is the same call made twice already this week: the pages, the shell strings and the vendor locale the editor loads (pt.json, not pt-pt.json) are all Brazilian.

Landing pages also gain the inLanguage their WebApplication node was missing — the homepage and the documentation pages already had it.

Reverse-checked: dropping the og:locale line turns the new assertion red on every generated page.

Checked in this pass and clean

  • Internal links: 158 pages, 5043 link instances, 165 distinct targets — every one requested, zero 4xx.
  • Basic accessibility across five page kinds: no image without alt, no link or button without an accessible name, no heading-level jumps, exactly one h1 per page, <html lang> everywhere. The format index rows, rail links and language select are all reachable by keyboard.
  • First paint: a landing page is 10 requests / 392 KB, FCP 44 ms. The homepage's 9 MB is landing-prefetch.js warming all three editor engines after load (existing behaviour, pinned by e2e); over the wire it is Brotli — sdk-all.js 13.7 MB → 3.0 MB.
  • Cache headers: sdkjs/ and web-apps/ deliberately skip immutable (they carry our patches and the iframe HTML). The locale files backfilled in fix(editor): a missing translation must not become a document error #194 live in that tree, but the service worker names its runtime cache after VENDOR_VERSION, so a vendor change is a new cache and cannot serve the old copies.

docs/explorations/2026-08-23-seven-languages-audit.md is updated with this pass.

🤖 Generated with Claude Code

hreflang has carried the full seven-language graph since the translations
landed. Open Graph was never told: no og:locale, no og:locale:alternate.
Every consumer that reads OG rather than hreflang -- Facebook, LinkedIn,
Slack, most scrapers -- therefore treated a share of /ja/ or /pt/ as an
English page.

Each page now declares its own og:locale and lists the six others as
og:locale:alternate, from the same set hreflang uses, so the two cannot
drift apart.

The mapping lives in LOCALES because Open Graph wants language_TERRITORY
rather than BCP 47: en_US, zh_CN, ja_JP, de_DE, es_ES, ko_KR and pt_BR.
That last one is the same call made twice already this week -- the pages,
the shell strings and the vendor locale the editor loads (pt.json) are
all Brazilian.

Landing pages also gain the inLanguage their WebApplication node was
missing; the homepage and the documentation pages already had it.

Reverse-checked: dropping the og:locale line turns the new assertion red
on every generated page.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chaxus
chaxus enabled auto-merge (rebase) August 23, 2026 04:38
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying document with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4fc3e65
Status: ✅  Deploy successful!
Preview URL: https://9433d403.document-7hm.pages.dev
Branch Preview URL: https://og-locale.document-7hm.pages.dev

View logs

@chaxus
chaxus merged commit f39b503 into main Aug 23, 2026
18 checks passed
@chaxus
chaxus deleted the og-locale branch August 23, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant