Skip to content

fix(api): reconcile seeded language translations on startup#1783

Open
MrDirkelz wants to merge 2 commits into
mainfrom
1780-api-auto-update-new-language-translation-strings-from-seeding-docs
Open

fix(api): reconcile seeded language translations on startup#1783
MrDirkelz wants to merge 2 commits into
mainfrom
1780-api-auto-update-new-language-translation-strings-from-seeding-docs

Conversation

@MrDirkelz

Copy link
Copy Markdown
Collaborator

Add an idempotent startup step that syncs seeded English/French translation keys into language docs, prunes stale keys across all languages, and preserves existing production values.

Add an idempotent startup step that syncs seeded English/French translation keys into language docs, prunes stale keys across all languages, and preserves existing production values.
@MrDirkelz MrDirkelz self-assigned this Jul 6, 2026
Add an idempotent startup reconciler for seeded English/French translation keys and cover bootstrap wiring in tests.
@johan-bell

Copy link
Copy Markdown
Collaborator

reconcileLanguageTranslationSeeds processes every Language doc via processAllDocs([DocType.Language], ...), but the key-pruning loop (lines 55-61) isn't scoped to SEEDED_LANGUAGE_IDS — it drops any key not in the English/French seed's key set from every language document, not just lang-eng/lang-fra. The included test even demonstrates this: the lang-spa fixture loses its legacy.key alongside the seeded docs. On a real deployment this means any translation key added for a non-English/French language (via CMS or otherwise) that isn't also present in the English/French seed gets silently deleted on every API restart. Pruning should only apply when doc._id is in SEEDED_LANGUAGE_IDS; other languages should pass through untouched.

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.

API: Auto-update new language translation strings from seeding docs

2 participants