Agent Skills › ArcReel/ArcReel › translate-docs

translate-docs

GitHub

自动化翻译文档源文件至英文,通过脚本校验翻译一致性并刷新锁文件。支持发现缺失、过期及孤立条目,强制统一术语,确保译文与源码同步且格式正确。

.claude/skills/translate-docs/SKILL.md ArcReel/ArcReel

Trigger Scenarios

需要翻译或更新英文文档时 检查文档翻译一致性时

Install

npx skills add ArcReel/ArcReel --skill translate-docs -g -y
More Options

Non-standard path

npx skills add https://github.com/ArcReel/ArcReel/tree/main/.claude/skills/translate-docs -g -y

Use without installing

npx skills use ArcReel/ArcReel@translate-docs

指定 Agent (Claude Code)

npx skills add ArcReel/ArcReel --skill translate-docs -a claude-code -g -y

安装 repo 全部 skill

npx skills add ArcReel/ArcReel --all -g -y

预览 repo 内 skill

npx skills add ArcReel/ArcReel --list

SKILL.md

Frontmatter
{
    "name": "translate-docs",
    "description": "Translate every dirty ArcReel documentation source into English and refresh the translation lockfile.",
    "disable-model-invocation": true
}

Translate Docs

Run this workflow from the repository root. Translate prose directly; the bundled scripts discover source/target pairs, record source fingerprints, and check the mechanical invariants.

1. Discover the batch

Synchronize the generated contributing copy first, so Step 3's CONTRIBUTING.md translation always reads current content rather than a stale or absent file:

set -euo pipefail
cd website
pnpm sync-contributing
cd ..
node .claude/skills/translate-docs/scripts/translation-lock.mjs status

Treat every reported item as one batch:

  • missing: create the reported target from the complete source.
  • stale: align the existing target with the current source. Targets are often hand-maintained alongside their sources, so a stale fingerprint can mean anything from one changed sentence to a rewritten page; compare the two section by section, keep wording that is still faithful, and rewrite what has drifted.
  • frontmatter: make the target's untranslated frontmatter match the source (see Step 3).
  • orphan: delete the reported target if it exists; the later record command removes the obsolete lock entry.

Finish discovery only after every item has an explicit action. The lockfile changes only through record.

For a large batch, dispatch subagents by file group. Give each one its exact source → target pairs and point it at Steps 2 and 3 of this file.

2. Load terminology

Before translating prose, search these truth sources for established English product terms:

  • Frontend English locale: frontend/src/i18n/en/
  • README.en.md

These sources are the glossary; reuse their exact terminology, including UI labels quoted in prose.

When those sources conflict, use the official name a reader outside China would recognize for the same product, not the name of a different product. Documentation translates 阿里百炼 as DashScope, matching README.en.md's established usage; the frontend locale's per-endpoint Alibaba Model Studio labels do not govern documentation.

Product identity itself is invariant across target languages. Translate 剪映 as Jianying: CapCut is a separate international product, and ArcReel has not verified draft compatibility with it. CapCut appears only where a page states that distinction.

3. Translate every dirty source

Translate natural-language prose and link text into clear technical English. Preserve the document's information, tone, section order, lists, tables, and formatting.

Apply these invariants to every file:

  • In frontmatter, translate only values of title, description, and sidebar_label. Copy every other key and value from the source exactly; status reports a frontmatter item and record refuses to run until they match.
  • Preserve inline code exactly.
  • Inside fenced code blocks, preserve the executable substance exactly: commands, program output, identifiers, configuration keys, and paths or filenames that other software really produces. Translate the human-readable text a reader is meant to read: diagram node labels, comments, instructional placeholder values, and fences that hold prose rather than code. A literal repository convention written in Chinese stays in Chinese — Chinese commit-message examples, changelog section names, and placeholders such as <中文理由> describe what a contributor must actually type.
  • Translate human-readable link text. Point each link destination at its English counterpart when one exists; otherwise keep the destination exactly:
    • A heading inside the same document: link to the target document's own heading. README.md has no explicit anchor IDs, so README.en.md links to the English heading slug — #快速开始 becomes #quick-start.
    • The documentation site: the default locale is unprefixed, so every docs.arc-reel.com/... destination gains an /en/ prefix (https://docs.arc-reel.com/guide/... becomes https://docs.arc-reel.com/en/guide/...).
    • An external page with an English edition: link to that edition, such as a repository's README.en.md in place of its #readme.
  • Preserve ::: admonition marker lines exactly. Translate prose inside the admonition.
  • Preserve explicit anchor IDs such as {#deployment} exactly. Translate their headings.
  • Keep product names, command names, paths, configuration keys, environment variables, identifiers, and version constraints unchanged.

The lock pipeline currently registers English targets only: targetForSource in translation-lock.mjs maps every source into website/i18n/en/. Before adding another documentation locale, extend that forward mapping first — otherwise every file of the new locale is reported as an unregistered orphan and record refuses to run.

README.md maps to README.en.md. CONTRIBUTING.md maps to website/i18n/en/docusaurus-plugin-content-docs/current/dev/contributing.md; base that target on the synchronized website/docs/dev/contributing.md so its generated frontmatter and {#contributing} anchor remain intact. The lockfile records CONTRIBUTING.md as the source key but fingerprints that synchronized copy's content, not the root file's, so a sync-contributing.mjs change alone can also mark the target stale. Other Markdown sources use the exact targets printed by status.

Finish this step only when every orphan target is gone and every missing or stale target is a complete English rendering: each source section has its counterpart in the target, and the target holds nothing the source lacks.

4. Refresh UI translations

Generate the current Docusaurus message inventory, then check it:

set -euo pipefail
cd website
pnpm write-translations --locale en
cd ..
node .claude/skills/translate-docs/scripts/ui-messages.mjs

ui-messages.mjs removes the generated footer copyright key and lists every English message value still carrying Chinese text. Translate each listed message in place, preserving JSON keys, description values, and placeholders such as {count} exactly. Finish when the script prints UI messages are translated.

5. Record and verify

After all translations are complete, record LF-normalized SHA-256 fingerprints and verify the batch is clean:

set -euo pipefail
node .claude/skills/translate-docs/scripts/translation-lock.mjs record
node .claude/skills/translate-docs/scripts/translation-lock.mjs status
cd website
pnpm typecheck
pnpm build

record refuses to update the lockfile while a target is missing, while a target's untranslated frontmatter differs from its source, and while any Markdown file under website/i18n/*/docusaurus-plugin-content-docs/current/ has no source mapping to it. Completion requires status to print Translations are up to date., typecheck to pass, and the build to emit both build/ and build/en/ without broken links or anchors.

Version History

  • 8d9d3a0 Current 2026-10-19 08:05

    改为逐节对齐而非全量重译;新增 frontmatter 和界面文案的脚本检查;优化 CONTRIBUTING 同步逻辑及中文识别覆盖范围。

  • 44d22bf 2026-08-28 10:40

    明确标注正向映射仅登记 en 的前提,防止新增 locale 时误报孤儿;同步更新相关 SKILL.md 与脚本约束。

  • feafcb4 2026-08-20 00:25

Same Skill Collection

.agents/skills/add-release-highlights/SKILL.md
.agents/skills/afk-team-workflow/SKILL.md
.agents/skills/ask-matt/SKILL.md
.agents/skills/code-review/SKILL.md
.agents/skills/codebase-design/SKILL.md
.agents/skills/diagnosing-bugs/SKILL.md
.agents/skills/domain-modeling/SKILL.md
.agents/skills/emil-design-eng/SKILL.md
.agents/skills/frontend-design/SKILL.md
.agents/skills/grilling/SKILL.md
.agents/skills/handoff/SKILL.md
.agents/skills/implement-spec/SKILL.md
.agents/skills/implement/SKILL.md
.agents/skills/improve-codebase-architecture/SKILL.md
.agents/skills/pr-ai-review-loop/SKILL.md
.agents/skills/prototype/SKILL.md
.agents/skills/receiving-code-review/SKILL.md
.agents/skills/research/SKILL.md
.agents/skills/resolving-merge-conflicts/SKILL.md
.agents/skills/setup-matt-pocock-skills/SKILL.md
.agents/skills/shadcn/SKILL.md
.agents/skills/systematic-debugging/SKILL.md
.agents/skills/tdd/SKILL.md
.agents/skills/teach/SKILL.md
.agents/skills/tech-doc-style-chinese/SKILL.md
.agents/skills/to-questionnaire/SKILL.md
.agents/skills/to-spec/SKILL.md
.agents/skills/to-tickets/SKILL.md
.agents/skills/triage/SKILL.md
.agents/skills/update-docs/SKILL.md
.agents/skills/vercel-react-best-practices/SKILL.md
.agents/skills/wait-what/SKILL.md
.agents/skills/wayfinder/SKILL.md
.agents/skills/web-design-guidelines/SKILL.md
.agents/skills/wizard/SKILL.md
.agents/skills/writing-for-agents/SKILL.md
.agents/skills/writing-great-skills/SKILL.md
agent_runtime_profile/.claude/skills/adapt-custom-endpoint/SKILL.md
agent_runtime_profile/.claude/skills/compose-video/SKILL.md
agent_runtime_profile/.claude/skills/edit-video/SKILL.md
agent_runtime_profile/.claude/skills/generate-assets/SKILL.md
agent_runtime_profile/.claude/skills/generate-grid/SKILL.md
agent_runtime_profile/.claude/skills/generate-narration-audio/SKILL.md
agent_runtime_profile/.claude/skills/generate-script/SKILL.md
agent_runtime_profile/.claude/skills/generate-storyboard/SKILL.md
agent_runtime_profile/.claude/skills/manage-project/SKILL.md
skills/video-workflow/SKILL.md
.agents/skills/afk-retrospective/SKILL.md
.agents/skills/agent-browser/SKILL.md

Metadata

Files
0
Version
8d9d3a0
Hash
8f8d697d
Indexed
2026-08-20 00:25

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-24 23:44
浙ICP备14020137号-1