koala73 / koala73/worldmonitor

chore(i18n): main app locales have no staleness tracking — src/locales/ still only key-existence checked

Open
#5,645 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
86.6k
Forks
13.1k
Avg merge
8h 4m
Merged PRs (30d)
825

Description

Found while doing the #5633 translation pass.

#5633 added EN-baseline staleness tracking to `scripts/translate-locales.mjs`
and adopted it for the `/pro` marketing bundle (`pro-test/src/locales/`). The
**main app catalog (`src/locales/`, ~2,400 keys × 24 locales) still has the same
blindspot #5633 was filed for.**

### The gap

`tests/locale-completeness.test.mjs` checks that every locale *contains* every
`en.json` key. That is key-existence only — exactly the check that let #5633 sit
undetected. Nothing verifies that a present translation still corresponds to the
English text it was produced from, so:

- editing an English string leaves every translation of it silently wrong; and
- inserting one element into a translated array shifts every later index onto
the wrong string while all key-existence checks stay green.

### The fix is already wired, just not adopted

`scripts/translate-locales.mjs` is root-agnostic — `baselinePathFor(false)`
already resolves to `scripts/locale-baselines/app.json`. What is missing:

1. Seed `scripts/locale-baselines/app.json`. Unlike pro-test there is no clean
pre-change snapshot to seed from, so either accept "start tracking now"
(writes the current `src/locales/en.json`, leaving existing rot untracked) or
spend the effort to find a defensible historical snapshot per section.
2. Run the pass to clear whatever staleness the seed surfaces.
3. Extend `tests/pro-locale-freshness.test.mjs` (or add the app-root twin) with
the same two assertions: baseline in step with `en.json`, and every locale
complete + free of stale translations.

Step 1 is the judgement call worth making deliberately — seeding from the
current file makes the gate meaningful going forward but forgives all existing
drift, and the app catalog is ~4× the size of the pro one.

Contributor guide

Open the contributing guide

Research direction

Start with scripts/translate-locales.mjs and its baselinePathFor(false) resolution to scripts/locale-baselines/app.json, then inspect src/locales/en.json and the existing pro freshness test. Decide whether to seed from the current English catalog or establish a historical snapshot, run the locale pass, and extend tests/pro-locale-freshness.test.mjs for the app root. Done means the baseline matches en.json and all app locales are complete and free of stale translations.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
internationalization, testing, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.