Sync localized blog title and meta when English source changes
Problem
Localized blog pages can keep a stale <title> and meta description after the English post is retitled. Example checked on 2026-10-19:
- English: https://capgo.app/blog/how-delta-updates-reduce-payload-size/
- French (stale): https://capgo.app/fr/blog/how-delta-updates-reduce-payload-size/ still serves the old English title
How Delta Updates Reduce Payload Size - German (ok): https://capgo.app/de/blog/how-delta-updates-reduce-payload-size/ already reflects the new SEO title
Root cause
The translation worker already detects English HTML changes via X-Capgo-Translation-Source-Hash and refreshes executable scripts on cached STALE/HIT responses, but it did not refresh translatable head metadata (title, description, Open Graph, Twitter). Cached localized HTML could therefore keep outdated titles and descriptions until a full background retranslation finished (or indefinitely if the queue lagged).
Fix
On cached localized responses where the stored source hash differs from the current English HTML hash, the worker now:
- Keeps the existing executable script sync.
- Re-translates translatable head fields from the current English source and patches them into the cached HTML (
X-Capgo-Translation-Meta: synced). - Still enqueues full page retranslation via the existing stale/source-check pipeline.
Verification
- Extended
apps/translation-worker/scripts/verify-parser.tsSTALE blog coverage for meta sync. - Added
bun run check:blog-hash-driftinapps/translation-workerto list localized blog URLs whose stored translation hash does not match the live English HTML.
Affected URLs (sample)
Production scan on 2026-10-19:
- Known retitle mismatch: https://capgo.app/fr/blog/how-delta-updates-reduce-payload-size/
- FR blog pages with English-only titles (stale or untranslated meta): 90 URLs (first examples below)
- https://capgo.app/fr/blog/why-consent-management-matters-for-app-compliance/
- https://capgo.app/fr/blog/how-to-implement-feature-flags/
- https://capgo.app/fr/blog/capacitor-ota-updates-cloud-hosting-options-compared/
- https://capgo.app/fr/blog/automatic-build-and-release-with-github-actions/
- https://capgo.app/fr/blog/app-availability/
- FR blog pages with any translation source hash drift vs live English HTML: 483 URLs (hash drift includes body and layout changes, not only title retitles). Run
cd apps/translation-worker && bun run check:blog-hash-driftfor the full list.
After this worker deploys, the first request to each drifted URL should serve updated translated title and description immediately, while background jobs refresh the full cached page.
Remaining action after merge
- Merge and let Deploy Translation Worker run on
main(or run that workflow manually) so production picks up the worker change. - No manual KV/R2 purge is required for meta: response-path sync runs on the next localized blog request when the stored source hash differs from current English HTML.
- Optional: run
bun run check:blog-hash-driftafter deploy to confirm stored hashes converge as pages are visited and background retranslations complete.


Need help on this PR? Tag @codesmith-bot with what you need.
Summary by CodeRabbit
- New Features
- When an English blog page changes, its localized versions now update translated page titles and supported SEO metadata alongside existing content. Repeated source text uses consistent translations, and short SEO descriptions are expanded when metadata changes.
- Bug Fixes
- Localized blog pages are less likely to display outdated titles or descriptions after their English source is updated.