Skip to content

Enforce locale key parity and English fallback in i18n #49

Description

@priscaenoch

Problem

The i18n layer ships three locales — src/i18n/locales/en.ts, es.ts, and ko.ts — that must stay in sync. Nothing verifies they share the same set of translation keys, so a key added to en.ts but not to es.ts/ko.ts will surface as a missing/blank string for those users, and there is no guaranteed fallback to English for missing keys.

What needs to be done

  • Ensure the i18n lookup falls back to the English string when a key is missing in the active locale.
  • Add a check (unit test or script) that fails when the non-English locales do not have the same key set as en.ts.
  • Wire that check into CI so drift is caught on pull requests.
  • Fill in (or explicitly mark) any keys currently missing from es.ts/ko.ts.

Files

  • src/i18n/index.ts, src/i18n/locales/*.ts
  • CI workflow

Acceptance deliverables

  • Missing keys fall back to English rather than rendering blank.
  • CI fails when locales diverge in their key sets.
  • All CI checks pass; the change cannot be merged until CI is green.

Tests to pass

  • Test: es/ko key sets match en.
  • Test: a missing key resolves to the English string.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignbugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions