Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

translate

БесплатноЗапускает вложенные скриптыНе проверен

Translate new/changed English UI strings into all supported languages using a translate-review-refine pipeline. Invoke with /translate to detect untranslated…

shapeshiftот shapeshift★ 206 звёзд на GitHub

Об этом скилле

Automated i18n Translation Skill

Translates new or changed English UI strings into all 9 supported non-English languages using a translate-review-refine pipeline. Detects what changed, translates in batches with terminology glossary enforcement, validates output programmatically, and merges results into the existing translation files.

Supported Languages

Locale Language Register
de German Formal (Sie)
es Spanish Informal (tú)
fr French Formal (vous)
ja Japanese Polite (です/ます)
pt Portuguese (BR) Informal (você)
ru Russian Formal (вы)
tr Turkish Formal (siz)
uk Ukrainian Formal (ви)
zh Chinese (Simplified) Neutral/formal

See .claude/skills/translate/locales/{locale}.md for detailed locale-specific rules.

Precautions

  • Do not translate en — English is the source language.
  • Do not touch id or ko — these locales exist on disk but are not imported in index.ts or declared in constants.ts.
  • Preserve existing translations — only add/update keys, never delete existing translated keys.
  • Interpolation is sacred — %{variableName} placeholders must survive translation intact, including exact variable names.
  • JSON validity — all output files must be valid JSON. Validate before writing.
  • File format — 2-space indent, trailing newline, UTF-8 encoding (matches saveJSONFile in scripts/translations/utils.ts).
  • The glossary is a living document — it grows over time as new terms are identified. Check it at the start of every run.

Step 1: Compute Translation Diff

Determine which English strings need translation.

1a. Check for marker file

Read src/assets/translations/.last-translation-sha

1b. If marker file exists — diff-based detection

The marker contains a git SHA from the last translation run. Use it to find new/modified English strings since then.

node .claude/skills/translate/scripts/diff.js

This follows the same recursive comparison pattern as scripts/translations/utils.ts findStringsToTranslate().

1c. If no marker file — missing-key detection

Compare each non-English language against English to find missing keys:

node .claude/skills/translate/scripts/missing-keys.js

1d. Early exit

If no changes or missing keys are found, print:

Translations are up to date. No new or modified English strings detected.

and stop.

1e. For modified keys (English value changed)

Mark these as needing re-translation in ALL languages, not just those missing the key.

Step 2: Batching Strategy

Group the strings to translate by their top-level JSON namespace (the first segment of the dotted path, e.g., agenticChat, common, trade).

  • Target 20-50 strings per batch
  • If a namespace has more than 50 strings, split into sub-batches of 30-35 strings, preserving original key order
  • If a namespace has fewer than 5 strings, combine with other small namespaces into a single batch
  • Each batch item includes: { dottedPath, englishValue }
  • Keep batch contents together because namespace context improves translation consistency

Step 3: Load Glossary

Read src/assets/translations/glossary.json. This file contains:

  • Terms with value null = never translate, keep in English (e.g., "Bitcoin", "DeFi", "MetaMask")
  • Terms with locale-keyed objects = use the approved translation for that language (e.g., "staking" → "ステーキング" in Japanese)

The glossary is passed to every translator and reviewer sub-agent. If the glossary file is missing or contains invalid JSON, log an error and exit immediately with a clear message.

Step 3b: Cross-Reference Existing Translations for Term Consistency

Before translation begins, extract significant terms from the new English strings and search all namespaces in the target locale for existing translations containing those terms. This ensures that domain terms like "pool", "vault", "bridge", "fee", etc. are translated consistently with how they've already been translated elsewhere in the app — even across different namespaces.

Run the term-context script once per locale at pipeline start:

node .claude/skills/translate/scripts/term-context.js LOCALE NEW_STRINGS_JSON_OR_FILE
  • LOCALE — the target locale code (e.g., fr)
  • NEW_STRINGS_JSON_OR_FILE — path to a temp file containing the new strings as [{ path, value }] array or { "dotted.path": "english value" } object

The script:

  1. Extracts significant words and 2-word phrases from the new English strings (filtering stop words and glossary terms which are already handled)
  2. Searches the full {locale}/main.json for existing translated strings whose English source contains those terms
  3. Returns up to 3 matches per term, prioritizing multi-word phrases, capped at 30 terms total

Output format:

{
  "liquidity pool": [
    { "key": "defi.liqu
Полный SKILL.md на GitHub

Установить translate в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Grep
Glob
Bash(node *)
Bash(git diff*)
Bash(git log*)
Bash(git rev-parse*)
Bash(wc *)
Bash(mkdir *)
Task
AskUserQuestion

Вложенные файлы

locales/de.mdlocales/es.mdlocales/fr.mdlocales/ja.mdlocales/pt.mdlocales/ru.mdlocales/tr.mdlocales/uk.mdlocales/zh.mdscripts/diff.jsscripts/merge.jsscripts/missing-keys.jsscripts/prepare-locale.jsscripts/script-utils.jsscripts/term-context.jsscripts/validate-file.jsscripts/validate.js

FAQ

Что делает скилл translate?

Translate new/changed English UI strings into all supported languages using a translate-review-refine pipeline. Invoke with /translate to detect untranslated strings and produce high-quality translations for de, es, fr, ja, pt, ru, tr, uk, zh.

Как установить скилл translate?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл translate запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить translate с