Agent Skills › elie222/rakazo › translate

translate

GitHub

自动化填充 Web 应用翻译目录中的未翻译字符串,处理分支同步、差异合并及批量翻译,并执行验证后提交或更新 Pull Request。

.agents/skills/translate/SKILL.md elie222/rakazo

Trigger Scenarios

请求翻译应用内容 填充翻译空缺 更新翻译目录的 Pull Request 定时翻译任务

Install

npx skills add elie222/rakazo --skill translate -g -y
More Options

Non-standard path

npx skills add https://github.com/elie222/rakazo/tree/main/.agents/skills/translate -g -y

Use without installing

npx skills use elie222/rakazo@translate

指定 Agent (Claude Code)

npx skills add elie222/rakazo --skill translate -a claude-code -g -y

安装 repo 全部 skill

npx skills add elie222/rakazo --all -g -y

预览 repo 内 skill

npx skills add elie222/rakazo --list

SKILL.md

Frontmatter
{
    "name": "translate",
    "description": "Fill untranslated strings in the web translation catalogs (`apps\/web\/src\/locales\/*\/messages.po`) and open or update the translation pull request. Use when asked to translate the app, fill translation gaps, or update the \"Update translation catalogs\" pull request, and on the scheduled translation run."
}

Translate the web catalogs

catalog-gaps.ts, next to this file, finds and fills empty entries without touching anything else. Run it from the repo root.

1. Pick the branch

If an open pull request from i18n/catalog-sync exists (gh pr list --head i18n/catalog-sync --state open), check out that branch; otherwise branch i18n/translate-<date> from origin/main. Either way, bring in the newest strings before translating:

  1. Merge origin/main. If a messages.po conflicts, keep the branch's copy (git checkout --ours -- <file>) so its translations survive, and finish the merge.
  2. Run pnpm --filter @rakazo/web intl:extract. It adds main's new strings and drops removed ones, keeping every existing translation.
  3. Fill in anything main translated that the branch had not, for each locale: git show origin/main:apps/web/src/locales/<locale>/messages.po > /tmp/main-<locale>.po, then node .agents/skills/translate/catalog-gaps.ts apply <locale> /tmp/main-<locale>.po.
  4. Commit the result.

Run node .agents/skills/translate/catalog-gaps.ts check. If it exits 0, push what step 1 committed if you are on i18n/catalog-sync (your own branch needs no pull request when nothing changed), and stop. Otherwise translate the gaps and fix any reported mismatch.

2. Translate

For each locale with gaps, node .agents/skills/translate/catalog-gaps.ts list <locale> prints the empty entries with their source files and placeholder notes. With several locales, fan out one subagent per locale (pair the small ones).

  • Read the catalog's existing translations first and match their terms, tone and formality. Keep "Rakazo" and other names as they are.
  • Keep every placeholder ({name}, {0}), numbered tag (<0>…</0>, <1/>) and plural #. In plural/select messages keep the structure and variable, translate only the branch text, and use the language's own plural categories (Russian one/few/many/other, Hebrew one/two/other, Japanese, Korean and Chinese only other).
  • Short labels stay short. Read the source file when the meaning is unclear. Use the source text for code, URLs and example values.

Write translations as JSON objects { "<key>": "<translation>" }, about 120 per file, using the exact key from list. Apply each file with node .agents/skills/translate/catalog-gaps.ts apply <locale> <file.json>; it only fills entries that are still empty.

3. Verify

  • node .agents/skills/translate/catalog-gaps.ts check exits 0.
  • pnpm --filter @rakazo/web exec lingui compile --strict passes.
  • pnpm exec vitest run apps/web/src/lib/i18n apps/web/src/lib/agent-import-locales apps/web/src/lib/bot-templates-locales passes.
  • Only translations changed: git diff -U0 -- apps/web/src/locales | grep -E '^[-+][^-+]' | grep -vE '^[-+]msgstr ' prints nothing.

4. Ship

Commit only the messages.po files and push. On i18n/catalog-sync, that push starts CI and stops the sync workflow from overwriting the branch until it merges. On your own branch, open a pull request titled "Translate new web strings" that says which locales changed and that no native speaker reviewed them.

Take it to green with .agents/skills/pr-watch/SKILL.md. If you were asked to merge, squash-merge once checks pass and review comments are resolved.

Version History

  • 096162c Current 2026-11-07 11:22

Same Skill Collection

.agents/skills/composio/SKILL.md
.agents/skills/pr-watch/SKILL.md
.agents/skills/release/SKILL.md
.agents/skills/ux-declutter/SKILL.md
examples/plugins/mcp-server/skills/search-docs/SKILL.md
examples/plugins/hello-world/skills/say-hello/SKILL.md

Metadata

Files
0
Version
096162c
Hash
8c03cb02
Indexed
2026-11-07 11:22

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-10 13:27
浙ICP备14020137号-1