i18n-translate
Installation
SKILL.md
Frontend i18n Translation Workflow
Mandatory Preflight
- Read this entire
SKILL.mdbefore any frontend i18n work, including one-key fixes. - Before editing locale files, confirm the source text comes from a
t(...)key,en.json, existing UI copy, or an explicitly requested new UI string. - Use the user conversation only to understand the task target. Do not copy conversation text, review wording, or task descriptions directly into locale values.
- Before translating each key, re-think the intended UI copy from the code and locale context instead of treating the surrounding chat as the translation source.
Hard Constraint: Locale Writes Go Through the Script
- You MUST NOT edit
web/src/i18n/locales/*.jsondirectly with text-editing tools (StrReplace, Write, search-and-replace, manual JSON edits, etc.). This applies even to a single key. - ALL locale writes MUST go through the
add-missing-keys.mjsscript, followed bybun run i18n:sync. The script is the only sanctioned way to add or change locale values. - Why this is mandatory, not optional:
- Hand-editing reliably drops one or more of the seven locales (
en,zh,zh-TW,fr,ja,ru,vi), leaving keys missing in some languages. - Hand-editing breaks the required alphabetical key order and introduces JSON syntax errors (trailing commas, mismatched quotes).
- The script writes all seven files atomically with consistent sorting, so the locale set stays in sync by construction.
- Hand-editing reliably drops one or more of the seven locales (
- The script does not do the translation for you. You still must reason out each locale's copy and populate the script's
newKeysobject; the script only handles insertion, sorting, and writing. Do not skip the script just because the thinking happens regardless.