← ClaudeAtlas

sync-localeslisted

Sync or regenerate control/messages/<locale>.json from en.json via the deterministic locale-sync helper — extract the unique-string todo, translate it (inline or one worker subagent at a time), mint and validate. One locale at a time, never parallel. Invoke as `/sync-locales <locale> [<locale> ...]` for an incremental sync, `/sync-locales --fresh <locale> ...` for full regeneration, and also to bootstrap brand-new locales (supersedes the old /translate-messages).
zombico/mojulo · ★ 0 · AI & Automation · score 62
Install: claude install-skill zombico/mojulo
# /sync-locales Bring `control/messages/<locale>.json` files in line with `control/messages/en.json` using [control/scripts/locale-sync.mjs](control/scripts/locale-sync.mjs). The model's only job is translating a flat list of unique strings; all file assembly, dedup, resume bookkeeping, and validation are deterministic script code. Why this shape: the previous skill fanned out parallel subagents that each held the full ~100KB catalog in context and rewrote whole locale files — session limits blew up sessions mid-write and corrupted locales. Here workers run **strictly one at a time**, read only a todo slice, append line-by-line to a JSONL, and never touch `messages/*.json`. A blown worker costs a retry of its remaining strings, nothing more. ## Invocation `/sync-locales <code> [<code> ...] [--fresh]` — BCP-47 codes (`es`, `fr`, `pt-BR`, …). No codes → **stop and ask** which locales. `--fresh` (or the user asking to "regenerate") skips the translation memory and retranslates everything. ## Per-locale flow (strictly sequential across locales) ### 0. Sanity checks (once, before any locale) - Reject codes not matching `^[a-z]{2,3}(-[A-Z]{2})?$`, and reject `en`. - Every code must be in `localeNames` in [control/i18n/config.js](control/i18n/config.js). If missing, ask the user for the autonym, add it, and add the code to `rtlLocales` if the script is RTL. - `cd control && node scripts/validate-locale.mjs en en` must print `en.json: ok`. ### 1. Extract ``` cd control &