Sync every locale file under locales/ against locales/en.json. By default, identical entries
are copied directly, while fuzzy and missing entries are reviewed first and applied only after
the user approves. The config can widen or narrow the auto-sync set — but widening it removes the
approval gate, never the review behind it: every fuzzy and every missing entry is reviewed
whatever the config says, and only an auto-applied identical entry skips the scoring. Never edit
locales/en.json.
Configuration
Read .i18n-sync.json at the repo root, once, before anything else. Its autoSync key is an
array drawn from identical, fuzzy, missing. Default: ["identical"]. A category in the
auto-sync set auto-applies; a category outside the set is gated on the user's approval.
An empty array [] is the fully gated mode: nothing applies without approval. An invalid value —
a non-array, an entry outside the three categories — means stop and report the invalid config
rather than guess, because a guessed policy silently substitutes behavior the repo did not
choose.
Three rules bound what "auto" means. Later steps cite these rules by number rather than
restating them:
- Review is the constant. Every entry is scored except an identical entry in the auto-sync
set — fuzzy and missing entries are always scored, and a gated identical entry is scored too,
because a gate without scoring would ask the user to approve blind.
- Of the scored entries, auto applies only a match score above 0.9. A lower score always
stops for approval, whatever the auto-sync set says — auto-sync removes the ceremony for clean
entries, never the safety net for doubtful ones.
- No
autoSync value makes a plural-form entry automatic. Plural rules vary by locale, so a
plural entry is always scored and always stops for approval.
Steps
- Bucket. Compare each locale file against
locales/en.json and bucket every entry as
identical (same key, same source text), fuzzy (same key, changed source text), or
missing (key absent from the locale). Present the three buckets as a table before touching
anything, alongside the resolved auto-sync set and its provenance.
- Auto identical entries. When
identical is in the auto-sync set, copy those entries
directly and re-run the comparison, because a copy that lands wrongly must surface now rather
than in the report. When identical is not in the set, tick this step as skipped — the
identical entries join step 3's scoring pool like every other entry.
- Score the remaining entries. Compute a match score for every entry step 2 did not apply,
and decide the Action column per entry by the three rules in Configuration:
auto
when the entry passes rule 1 (its category is in the auto-sync set), rule 2 (its score is
above 0.9), and rule 3 (it is not a plural form), approval for every other entry.
- Apply the auto rows. Apply them without asking — that is what the config chose, and rule 2
already kept every doubtful entry out of this set — one bucket at a time, re-running the comparison after each bucket, so a regression cleanly
identifies which bucket caused it.
- Approval gate. Stop and await the user's choice on every
approval row — every plural
entry lands here by rule 3 — because an entry applied without approval is a translation the
user never reviewed. After the user decides,
apply the approved entries one bucket at a time, as in step 4, then re-run it to confirm the
drift has cleared.
- Report. Summarize what was applied (auto versus approved) per bucket, what was deferred,
and every step the config emptied, ticked with a "skipped — why" note rather than silently
omitted. The changes stay uncommitted, because the user reviews the working tree before
committing.
1---2name: syncing-translations3description: Synchronizes the host project's locale files against the source-of-truth English catalog — buckets entries into identical, fuzzy, and missing, auto-applies the configured categories, and gates the rest on user approval. Use when locale files drift behind the English catalog or translations need syncing.4---56Sync every locale file under `locales/` against `locales/en.json`. By default, identical entries7are copied directly, while fuzzy and missing entries are reviewed first and applied only after8the user approves. The config can widen or narrow the auto-sync set — but widening it removes the9approval gate, never the review behind it: every fuzzy and every missing entry is reviewed10whatever the config says, and only an auto-applied identical entry skips the scoring. Never edit11`locales/en.json`.1213## Configuration1415Read `.i18n-sync.json` at the repo root, once, before anything else. Its `autoSync` key is an16array drawn from `identical`, `fuzzy`, `missing`. Default: `["identical"]`. A category in the17auto-sync set **auto-applies**; a category outside the set is **gated** on the user's approval.18An empty array `[]` is the fully gated mode: nothing applies without approval. An invalid value —19a non-array, an entry outside the three categories — means stop and report the invalid config20rather than guess, because a guessed policy silently substitutes behavior the repo did not21choose.2223Three rules bound what "auto" means. Later steps cite these rules by number rather than24restating them:25261. **Review is the constant.** Every entry is scored except an identical entry in the auto-sync27 set — fuzzy and missing entries are always scored, and a gated identical entry is scored too,28 because a gate without scoring would ask the user to approve blind.292. **Of the scored entries, auto applies only a match score above 0.9.** A lower score always30 stops for approval, whatever the auto-sync set says — auto-sync removes the ceremony for clean31 entries, never the safety net for doubtful ones.323. **No `autoSync` value makes a plural-form entry automatic.** Plural rules vary by locale, so a33 plural entry is always scored and always stops for approval.3435## Steps36371. **Bucket.** Compare each locale file against `locales/en.json` and bucket every entry as38 **identical** (same key, same source text), **fuzzy** (same key, changed source text), or39 **missing** (key absent from the locale). Present the three buckets as a table before touching40 anything, alongside the resolved auto-sync set and its provenance.412. **Auto identical entries.** When `identical` is in the auto-sync set, copy those entries42 directly and re-run the comparison, because a copy that lands wrongly must surface now rather43 than in the report. When `identical` is not in the set, tick this step as skipped — the44 identical entries join step 3's scoring pool like every other entry.453. **Score the remaining entries.** Compute a match score for every entry step 2 did not apply,46 and decide the **Action** column per entry by the three rules in **Configuration**: `auto`47 when the entry passes rule 1 (its category is in the auto-sync set), rule 2 (its score is48 above 0.9), and rule 3 (it is not a plural form), `approval` for every other entry.494. **Apply the auto rows.** Apply them without asking — that is what the config chose, and rule 250 already kept every doubtful entry out of this set — one bucket at a time, re-running the comparison after each bucket, so a regression cleanly51 identifies which bucket caused it.525. **Approval gate.** Stop and await the user's choice on every `approval` row — every plural53 entry lands here by rule 3 — because an entry applied without approval is a translation the54 user never reviewed. After the user decides,55 apply the approved entries one bucket at a time, as in step 4, then re-run it to confirm the56 drift has cleared.576. **Report.** Summarize what was applied (auto versus approved) per bucket, what was deferred,58 and every step the config emptied, ticked with a "skipped — why" note rather than silently59 omitted. The changes stay uncommitted, because the user reviews the working tree before60 committing.