agentleFS
ZimoLiaoZimoLiao/scholaraio/.claude/skills/translate/SKILL.md

translate

Skill589 starsChanged todayMITView on GitHub

Use when the user wants to translate paper markdown, full papers, or batches into another language while preserving formulas, code blocks, and images.

48 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use faq, summarize and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AnthropicSkill

    faq

    Turn repeat questions into a pinned FAQ. Use when a champion keeps answering the same questions.

    Also in 3 projects that use this

  • mitsuhikoSkill

    summarize

    Fetch a URL or convert a local file (PDF/DOCX/HTML/etc.) into Markdown using `uvx markitdown`, optionally it can summarize

    Also in 8 projects that use this

  • jacobraskSkill

    calendar

    Interact with Apple Calendar via AppleScript. Use when the user asks to check calendar, view events, create events, manage schedule, find free time, or list calendars. Triggers include "my calendar", "my schedule", "calendar events", "create event", "add to calendar", "what's on my calendar", "free time", "available slots", "upcoming events", "today's events". Requires macOS with Calendar.app.

    Also in 3 projects that use this

  • AnthropicSkill

    analyze

    Answer data questions -- from quick lookups to full analyses. Use when looking up a single metric, investigating what's driving a trend or drop, comparing segments over time, or preparing a formal data report for stakeholders.

    Also in 4 projects that use this

  • sunnyclinches44Skill

    explain

    Explains code using real-world analogies and ASCII diagrams

    Also in 5 projects that use this

  • MicrosoftSkill

    web-search

    Also in 3 projects that use this

  • +2 more from anthropics

The file

Files
SKILL.md

论文翻译

将论文 Markdown 翻译为目标语言(默认中文),保留 LaTeX 公式、代码块、图片引用和 Markdown 格式。翻译结果保存为论文目录内的 paper_{lang}.md,原文保持不变;如需可携带分享,可额外导出到 workspace/_system/translation-bundles/<Author-Year-Title>/。

当前实现支持:

  • 单篇翻译时按 config.translate.concurrency 并发请求多个分块,并在终端显示块级进度
  • 在论文目录下创建临时工作目录,按块写入 parts/*.md
  • 网络抖动时对单块做超时重试与指数退避(默认最多 5 次尝试)
  • 中途中断后可从临时工作目录继续续翻
  • --force 会清理旧的临时翻译目录并从头重新翻译
  • --portable 会额外生成 workspace/_system/translation-bundles/<Author-Year-Title>/paper_{lang}.md 和对应的 images/

配置

config.yaml 中可设置默认行为:

translate:
  auto_translate: false   # 入库时是否自动翻译(默认关闭)
  target_lang: zh          # 目标语言(zh/en/ja/ko/de/fr/es)
  chunk_size: 4000         # 分块大小(字符数)
  concurrency: 20          # 总翻译并发预算(单篇时用于 chunk 并发,批量时会在论文间分摊)

每次调用时可通过 CLI 参数覆盖默认值。

执行逻辑

单篇翻译

scholaraio translate "<paper-id>" [--lang zh] [--force] [--portable]

批量翻译

scholaraio translate --all [--lang zh] [--force] [--portable]

查看翻译

scholaraio show "<paper-id>" --layer 4 --lang zh

作为 pipeline 步骤

scholaraio pipeline --steps toc,l3,translate

注意:translate 默认不在预设(full/ingest/enrich/reindex)中;可通过 --steps 显式指定。若 config.translate.auto_translate=true 且 pipeline 包含 inbox 步骤,translate 会在 papers 阶段自动注入。

工作流程

  1. 检测论文原文语言(基于字符集启发式检测)
  2. 如果已是目标语言,跳过
  3. 将 Markdown 按段落边界分块(保留代码块和公式完整性)
  4. 通过 LLM 逐块翻译,保留所有格式标记
  5. 单篇翻译会并发请求多个分块,但只按原顺序推进最终输出
  6. 在论文目录下创建临时工作目录(如 .translate_zh/),将每块分别写入 parts/*.md
  7. 状态写入 state.json / chunks.json;失败块会记录错误并在下次续翻时单独补跑
  8. 每个分块带超时重试和指数退避
  9. 若已有连续成功前缀,则同步刷新 paper_{lang}.md,方便中途查看已完成部分
  10. 若指定 --portable,则额外复制一份到 workspace/_system/translation-bundles/<Author-Year-Title>/,并复制 images/ 以保证脱离原目录后图片仍可用
  11. 若前面某块失败但后面某些块已成功,这些成功块仍会保留在临时工作目录里;下次续翻时会跳过已成功块,只补失败或未完成的块
  12. 全部完成后删除临时工作目录,并在 meta.json 中记录翻译元数据

进度与续翻

单篇翻译会输出:

  • 总块数
  • 当前块进度(如 翻译进度: 3/12)
  • 中断位置
  • 是否可续翻

如果中途中断:

scholaraio translate "<paper-id>" --lang zh

会自动检测论文目录下的临时翻译工作目录(如 .translate_zh/),并从未完成或失败的块继续。

如果想忽略已有部分结果并重新开始:

scholaraio translate "<paper-id>" --lang zh --force

会删除旧的临时翻译目录和旧的 paper_zh.md,从头重新翻译。

示例

用户说:"把这篇英文论文翻译成中文" -> 执行 scholaraio translate "<paper-id>" --lang zh

用户说:"把所有论文翻译成中文" -> 执行 scholaraio translate --all --lang zh

用户说:"看这篇论文的中文版" -> 执行 scholaraio show "<paper-id>" --layer 4 --lang zh

用户说:"重新翻译这篇论文" -> 执行 scholaraio translate "<paper-id>" --force

用户说:"上次翻译到一半断了,继续翻" -> 直接执行 scholaraio translate "<paper-id>" --lang zh

用户说:"给我一份可以单独发给别人的译文,别丢图" -> 执行 scholaraio translate "<paper-id>" --lang zh --portable

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.