name: translate-typst-docs description: Translate or review Typst documentation TOML in this repository using the local helper, canonical repo rules, and git-based patch review. license: MIT metadata: author: typst-doc-cn/docs version: "1.0"
Translate or review Typst documentation TOML in this repository.
Use this skill when the user asks to translate, review, or suggest changes for:
locales/docs/typst-docs.toml- files under
locales/docs/typst-docs/ - glossary-linked terms in
docs/terms.toml
Workflow
-
Read the canonical repo guidance before editing:
.github/copilot-instructions.mddocs/terms.toml
-
Run the helper before manually hunting for work whenever it can answer the question:
cargo run -p translate -- scanThe helper caps output at 50 issues by default so the target list stays reviewable. Re-run with all results only when you truly need the full backlog:
cargo run -p translate -- scan --limit 0Use structured output when you need machine-readable targets:
cargo run -p translate -- scan --format jsonTreat the helper output as the primary source of files, keys, and
main.<index>paragraph targets to patch. -
Resolve where the translation actually lives before editing:
- Inline entries are edited in
locales/docs/typst-docs.toml. - Entries whose checked-in
envalue looks like{{typst-docs/<key>.toml}}are stored in an included body file underlocales/docs/typst-docs/. - For split body files, patch the specific
[[main]]paragraph reported by the helper.
- Inline entries are edited in
-
Edit minimally and preserve repository conventions:
- Keep TOML structure valid.
- Preserve Markdown, Typst code, links, labels, and placeholders.
- Follow the terminology and term-link conventions from
docs/terms.toml. - Do not rewrite unrelated paragraphs when only one target needs work.
-
Improve the helper first if it cannot represent the case you need:
- Update
crates/translateso the workflow stays repeatable. - Add or adjust tests for the new case.
- Rerun the helper before continuing translation work.
- Update
-
Finish with patch-based review:
- Review applied edits with
git diff -- <files>. - If the user wants a suggestion without applying it, present the change as a unified diff / git-patch-compatible patch instead of prose-only guidance.
- Review applied edits with
Quick Checks
- If you changed the helper, run:
cargo test -p translate - If you changed translation files, keep the final diff small and easy to audit.