← ClaudeAtlas

i18n-translatelisted

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.
vam12375/shushu-api · ★ 0 · AI & Automation · score 67
Install: claude install-skill vam12375/shushu-api
# Frontend i18n Translation Workflow ## Overview - Locale files: `web/default/src/i18n/locales/{en,zh,fr,ja,ru,vi}.json` - Format: flat JSON under `"translation"` key, keys are English source strings - Base locale: `en.json` (most keys), fallback: `zh` (Chinese) - Sync script: `bun run i18n:sync` (from `web/default/`) - All `t()` calls must have corresponding keys in every locale file ## Workflow ### Step 1: Run sync and read report ```bash cd web/default && bun run i18n:sync ``` Read `web/default/src/i18n/locales/_reports/_sync-report.json` to see per-locale status (missingCount, extrasCount, untranslatedCount). ### Step 2: Find missing keys (used in code but not in locale files) Create and run `web/default/scripts/find-missing-keys.mjs`: ```javascript import fs from 'node:fs/promises' import path from 'node:path' const LOCALES_DIR = path.resolve('src/i18n/locales') const SRC_DIR = path.resolve('src') const en = JSON.parse(await fs.readFile(path.join(LOCALES_DIR, 'en.json'), 'utf8')) const enKeys = new Set(Object.keys(en.translation)) const tCallRegex = /\bt\(\s*['"`]([^'"`\n]+?)['"`]\s*[,)]/g const tCallMultilineRegex = /\bt\(\s*['"`]([^'"`]+?)['"`]\s*\)/g async function walkDir(dir) { const files = [] const entries = await fs.readdir(dir, { withFileTypes: true }) for (const entry of entries) { const fullPath = path.join(dir, entry.name) if (entry.isDirectory()) { if (['node_modules', '.git', 'locales', '_reports', '_extras'].includes(entry.