subtitle-translate
Skill1 starsChanged 2 months agoMITView on GitHub
Use when the user asks to translate English .srt subtitle files into Chinese (英文字幕翻译成中文),适用于 Blender/CG Fast Track 教程与数学课程(MIT 6.042J、18.06SC 等)两类字幕。保留序号与时间轴,输出 <原名>.zh.srt(.en.srt 去掉 .en);超过 200 条的长字幕自动走分片翻译后合并;按输入路径选用对应领域词表与规则(references/blender 或 references/math)。
2 other projects use a version of this.
Adopted by
Most recently taken up by
- ZJU-REAL/Easeltheir own version, first seen Oct 13, 2026
- Jaqen00/Skillstheir own version, first seen Mar 21, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- ZJU-REAL/Easel★ 4.5ksame name
- Jaqen00/Skills★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- math-graphSkill
- pic2pptSkill
- tax-filingSkill
The file
Files
SRT 英文字幕 → 中文翻译(Blender/CG 与数学课程统一技能)
领域判定(先判定,再翻译)
按输入路径判断课程类型,先读取并遵循对应领域的规则文件与词表:
- Blender / CG Fast Track 教程(路径含
CG Fast Track等)→ 读取${CLAUDE_SKILL_DIR}/references/blender/workflow.md与${CLAUDE_SKILL_DIR}/references/blender/glossary.md - 数学课程(如
MIT 6.042J Mathematics for Computer Science, Spring 2015、MIT 18.06SC Linear Algebra, Fall 2011等目录)→ 读取${CLAUDE_SKILL_DIR}/references/math/workflow.md与${CLAUDE_SKILL_DIR}/references/math/glossary.md - 无法从路径判断时,按内容特征(建模/软件术语 vs 数学公式)判定领域,并在最终报告中说明所采用的领域规则
公共翻译规则(所有领域通用)
- 只翻译文本行。序号、时间轴(
HH:MM:SS,mmm --> HH:MM:SS,mmm)和空行结构原样保留 - 一个条目的文本跨多行时整体翻译,译文条目内尽量写成一行,仅在句子结束处(句号/问号/感叹号/省略号)断行;不跨条目合并或拆分语义
- 保留
<i>、<font>、{\an8}等字幕标签和♪、[...]等符号,只译其中文字 - 术语首次出现用「中文(English)」格式,之后只用中文;具体译法以命中领域的词表(glossary.md)为准
- 翻译符合中文口语习惯,避免直译腔;结合前后条目的语境理解再译
- 不确定的专有名词或谐音梗,保留英文原文并在其后用括号注明译文
- 输出写入新文件
<原名>.zh.srt(video.en.srt→video.zh.srt,去掉.en,不要生成video.en.zh.srt),不覆盖原文件;UTF-8 编码(若播放器乱码,提示用户可改用带 BOM 的编码重新保存)
批量模式
- 用 Glob 搜索
**/*.srt,排除*.zh.srt - 已存在对应
.zh.srt的文件默认跳过(.en.srt对应去掉.en后的<原名>.zh.srt) - 逐个文件按「单片 / 分片」流程处理,最后报告:成功 N 个 / 跳过 M 个 / 失败 K 个
分片规则(文件较长时使用,两个领域一致)
- 判据:条目数 > 200(或文件约 2000 行以上)→ 必须先分片翻译,不可一次性硬译
- join(预处理:合并自动字幕拆在句子中间的断行,只在句末符号处保留换行;默认原地修改,
--out可另存新文件):python "${CLAUDE_SKILL_DIR}/tools/split_srt.py" join "<字幕路径>" - split(按条目拆分,保留原序号和时间轴,输出到字幕同目录
_split_parts/<原名>.partNN.srt):python "${CLAUDE_SKILL_DIR}/tools/split_srt.py" split "<字幕路径>" --per 200 - 若只有 1 片(总条数 ≤ 200),说明文件不长,按单片直接翻译即可
- 一次只处理一个分片:Read
partNN.srt→ 按规则完整翻译 → 写出_split_parts/<原名>.partNN.zh.srt,处理完再做下一片(不要多个分片同时进入上下文) - 全部分片翻译完成后 merge(按分片顺序拼接,序号连续、时间轴不变):
python "${CLAUDE_SKILL_DIR}/tools/split_srt.py" merge "<_split_parts 目录>" "<原目录>/<原名>.zh.srt" --zh- merge 只收集该视频自己的 zh 分片;多个视频的分片同处一个
_split_parts时,逐个视频完成「merge → 自检 → 清理该视频分片」后再放入下一个视频的分片
- merge 只收集该视频自己的 zh 分片;多个视频的分片同处一个
- 对合并后的中文文件再执行一次 join,兜底修复条目内残留的不必要断行
- 删除临时目录
_split_parts
完成自检(每个文件都要做)
.zh.srt条目数量与原文件一致- 所有时间轴与原文完全相同(diff 为空)
- 公式、字幕标签、变量与原文一致
- 分片文件额外核对:空 cue 集合与原文一致(cue 块只有序号+时间轴两行、无文本行)
归档
本技能不定义归档规则:翻译完成并自检后,如需把成果复制到归档目录,一律按工作区 CLAUDE.md 及对应课程的实际约定执行(不同课程的命名与目标目录不同,翻译阶段不处理归档)。
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
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.

