translate-i18n
БесплатноБез исполняемых скриптовНе проверенGenerate and update ShieldBattery's i18next translations (es, ko, ru, zh-Hans) from the English source strings, using full app + usage context. Use this…
от ShieldBattery★ 232 звезды на GitHubОб этом скилле
Translating ShieldBattery
Our UI strings live in i18next JSON files at server/public/locales/<lang>/<namespace>.json. en is
the source of truth (grown automatically by pnpm gen-translations, which only writes en). The
other languages (es, ko, ru, zh-Hans) must be filled in by translating from en.
The goal is translations that are clearly better than generic machine translation. We get there by bringing in context an MT engine doesn't have: what ShieldBattery is, where each string appears in the UI (a button vs. a tooltip vs. an error message), who is reading it, and a consistent glossary of game/brand terms.
Audience and tone: ShieldBattery serves a competitive StarCraft: Brood War community, roughly
20–50 years old. Lean toward the more casual, natural register for each language (how a player
would actually talk) rather than formal or corporate phrasing. Per-language specifics are in
glossary/<lang>.md.
The division of labor
All the mechanical, error-prone JSON work is done by a deterministic helper script, pnpm run i18n
(tools/i18n-translate.ts). You never hand-edit the JSON files.
Add new keys with apply, change existing ones with fix, move keys with rename. The script:
- finds keys present in
enbut missing in a target language (plural-aware) - finds orphan keys that no longer exist in
en(to delete) - resolves the correct plural forms per language from
Intl.PluralRules(the same CLDR data i18next uses at runtime) - validates that your translations preserve every
{{interpolation}}and<0>Trans tag - merges your translations back in and re-sorts/re-formats to exactly match the extractor's output
Your job is only to produce good translation values.
Commands
Run everything from the repo root. <lang> is es, ko, ru or zh-Hans; most commands also
take all, and working on all four languages together is the normal way to use them. Use
pnpm run -s i18n … to drop pnpm's echo line (check and stale exit non-zero when work remains,
which without -s also prints an ELIFECYCLE line; that is not a crash).
pnpm run -s i18n status # both namespaces: to-translate / orphan counts per language
pnpm run -s i18n show <keyOrPrefix>... [--grep <regex>] # en + every language side by side
pnpm run -s i18n plan <lang|all> <planFile> # write the to-translate work list as JSON
pnpm run -s i18n apply <lang|all> <resultFile> # validate + merge translations for MISSING keys
pnpm run -s i18n fix <lang|all> <resultFile> # validate + overwrite EXISTING translations
pnpm run -s i18n prune <lang|all> # delete orphan keys no longer present in `en`
pnpm run -s i18n check <lang|all> # read-only audit: remaining work, orphans, token drift, format
pnpm run -s i18n stale [lang|all] [outFile] # translations whose English source was reworded
pnpm run -s i18n rename <oldPrefix> <newPrefix> # move a key or subtree in every target language
pnpm run -s i18n terms <lang> <query> # look up Blizzard-matched game terms
Namespaces. global.json (the app) is the default. Pass --ns game (anywhere on the command
line) for game.json: the in-game UI's strings, which live in the Rust game DLL (tr! /
tr_plural! calls extracted by tools/i18next-rust-plugin.mjs) and are embedded into the DLL at
build time. Pass --ns email for email/locales/<lang>/email.json: the transactional account emails
(email/templates/*.tsx: email verification, password reset, username recovery, and notices of
password, email and login name changes). status covers every namespace; every other command works on
one at a time. Treat game strings as in-game HUD/dialog text: short, read at a glance mid-match, often
in caps labels (which are not uppercased for ko/zh-Hans). Write email strings plainly and politely, as
a service writing to its user; each *.title is also that email's subject line. Mailgun fills in the
{{username}}-style placeholders at send time, so they and the <2>…</2> index tags must come
through exactly as in English. After changing email translations, run pnpm gen-emails to re-render
the templates and subject lines the servers send.
Workflow
Do all four languages together: one round of context gathering, then consistent choices across languages.
1. See what needs doing
pnpm gen-translations # only if English strings changed in code since `en` was last extracted
pnpm run -s i18n status # missing + orphans, every namespace
pnpm run -s i18n stale # reworded English whose translations stayed behind (add --ns game/email too)
pnpm run -s i18n plan all <scratchpad>/plan.json
plan all writes one work list. Each item lists the languages missing it, and for plurals the forms
each of those languages requires:
{
"languages": ["zh-Hans", "ko", "ru", "es"],
Установить translate-i18n в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл translate-i18n?
Generate and update ShieldBattery's i18next translations (es, ko, ru, zh-Hans) from the English source strings, using full app + usage context. Use this whenever translations are out of date, a language is missing strings, or you're asked to translate/localize the UI. Produces context-aware, audience-appropriate, plural-correct translations.
Как установить скилл translate-i18n?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл translate-i18n запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic