Translate docs zh

From apache/fory-site · View interactive version

Translate docs zh is an AI agent skill from the GitHub repository apache/fory-site. Translate Apache Fory docs into Simplified Chinese and maintain existing Chinese translations by diffing English source changes. Use when asked to translate docs, sync i18n/zh-CN content, remove placeholder Chinese-intro notices, or update already-translated files after English docs changed. Strict

How to use this skill

Skill file

Translate Docs (zh-CN)

Translate documentation into Simplified Chinese and keep existing Chinese docs aligned with English source updates.

Hard Constraints

Terminology Reference (Required)

Path Mapping

Map source and target paths with these rules:

  1. Current docs:
  1. Versioned docs:
  1. Category labels:
  1. Sidebar top-level label i18n keys:

Workflow

Step 1: Discover file pairs

  1. Build source-target pairs from user scope.
  2. If user gives only Chinese targets, infer matching English source by reverse mapping.
  3. Skip pairs whose source file does not exist; report them clearly.

Step 2: Classify each Chinese file

Classify as untranslated or translated.

Treat as untranslated if any condition is true:

Otherwise classify as translated.

Step 3A: Handle untranslated files (full translation)

  1. Translate the entire document from current English source.
  2. Keep frontmatter keys and structure valid.
  3. Keep identifiers/code/protocol fields/CLI flags in English.
  4. Translate headings, prose, table descriptions, and comments meant for readers.
  5. Remove placeholder intro notices (中文导读 style blocks).
  6. Preserve link targets and anchors unless a better Chinese heading requires an explicit anchor.

Step 3B: Handle translated files (diff-based maintenance)

  1. Find source changes since last Chinese update baseline.
  2. Prefer this baseline method:
  1. If no source diff, keep Chinese file unchanged.
  2. If source diff exists, decide update strategy:

Use partial update when all are true:

Use full rewrite when any is true:

  1. Apply translations only for changed semantics; keep unaffected Chinese content stable.
  2. If full rewrite is chosen, regenerate complete Chinese content from latest English source.

Translation Quality Rules

  1. Prioritize semantic correctness over literal wording.
  2. Keep terminology consistent across files.
  3. Avoid awkward literal phrases (for example avoid unnatural jargon calques).
  4. Keep technical precision:
  1. Preserve examples and command behavior exactly.

Validation Checklist

Run checks after edits:

  1. Placeholder cleanup:
  1. Markdown integrity:
  1. MDX safety:
  1. Link/anchor sanity:
  1. Optional build verification (recommended):

Decision Heuristics for Rewrite vs Patch

Use this pragmatic threshold (guide, not absolute):

When uncertain, prefer full rewrite for short/medium docs and targeted patch for very large docs with clearly isolated changes.

Output Requirements for the user

Report clearly:

  1. Files fully translated.
  2. Files partially updated by source diff.
  3. Files fully rewritten due to large source changes.
  4. Validation results and any unresolved risks.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.