From ad35ab1d9a041b8b520d3c1299547f8d4a207d03 Mon Sep 17 00:00:00 2001 From: CaIon Date: Wed, 24 Jun 2026 20:46:30 +0800 Subject: [PATCH] feat: enhance i18n-translate skill --- .agents/skills/i18n-translate/SKILL.md | 31 +++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.agents/skills/i18n-translate/SKILL.md b/.agents/skills/i18n-translate/SKILL.md index 26f1ba64..654d2d7f 100755 --- a/.agents/skills/i18n-translate/SKILL.md +++ b/.agents/skills/i18n-translate/SKILL.md @@ -3,13 +3,28 @@ name: i18n-translate description: >- Complete and maintain frontend i18n translations for this project. Covers finding missing translation keys, detecting untranslated entries, and adding - translations for all supported locales (en, zh, fr, ja, ru, vi). Use when the - user asks to add translations, fix i18n, complete missing translations, or - when new UI text needs to be internationalized. + translations for all supported locales (en, zh, fr, ja, ru, vi). Use for any + task involving frontend locale files, missing translation keys, untranslated + UI text, `t(...)` keys, `useTranslation()`, static i18n keys, button/label/ + toast/dialog/placeholder/validation copy, or adding/fixing even a single + i18n key. Use when review findings mention missing i18n, when new UI text + needs translation, or when the user asks to add translations, fix i18n, or + complete missing translations. --- # Frontend i18n Translation Workflow +## Scope Checklist + +Before editing files, treat the task as covered by this skill if it involves: + +- `i18n`, translation, locale files, language packs, missing keys, or untranslated text +- `t('...')`, `useTranslation()`, `static-keys.ts`, or `locales/*.json` +- UI copy in buttons, labels, toasts, dialogs, placeholders, validation messages, descriptions, or table/empty states +- A review finding about missing i18n keys + +Do not skip this workflow because the fix is "just one key". + ## Overview - Locale files: `web/default/src/i18n/locales/{en,zh,fr,ja,ru,vi}.json` @@ -18,6 +33,16 @@ description: >- - Sync script: `bun run i18n:sync` (from `web/default/`) - All `t()` calls must have corresponding keys in every locale file +## Small Fix Path + +For a single known missing key: + +1. Confirm the exact key at the call site and verify it is absent from all locale files. +2. Add the key to every supported locale: `en`, `zh`, `fr`, `ja`, `ru`, `vi`. +3. Preserve the flat `"translation"` object and keep keys alphabetically sorted. +4. Run a targeted search for the key in code and locale files. +5. Run `bun run i18n:sync` when practical; if skipped, state that clearly. + ## Workflow ### Step 1: Run sync and read report