subtitle / by UGK Official

Subtitle Fluent Translator

给定一个本地源字幕文件,产出经过阅读理解、翻译和断句优化后的流畅中文字幕 SRT。

Install

ugk task install subtitle-fluent-translator

This task installs 7 files from the official manifest, including 2 script files.

Runtime input

subtitlePath必填,源字幕本地路径,支持 .srt 或 .vtt。必须原样提取为路径字符串。
targetLanguage可选,目标字幕语言,默认 zh-CN。
verbosity可选,翻译详略模式。只允许 normal 或 talkative。normal 为正常流畅字幕;talkative 为话痨模式。用户说“话痨模式”“更啰嗦”时填 talkative。
stylePrompt可选,翻译和改写风格。默认自然、口语化、适合视频字幕和中文配音。
glossary可选,用户在自然语言里明确提到的人名、队名、主题词、术语或动作名参考,dispatcher 抽取后用分号分隔,例如: bboy lunatic; breaking; toprock; freeze。翻译时作为权威参考,不要误译或改写。
maxUnitDurationMs可选,合并后的多 cue 字幕单元最大覆盖时长,默认 8000。单条源 cue 本身超长时允许保留。
maxUnitChars可选,每个字幕单元最大目标文字数。不填时 normal 默认 90,talkative 默认 160。

Acceptance

checksource.cues.json 存在且 cue 数量大于 0。
checkfluent.units.json 存在且每个单元有 ids 和非空 text。
checkfluent.zh.srt 存在、可解析、包含目标语言文本。
checkfluent.zh.srt 的每条 cue 时间来自源 cue ids 的首尾时间,整体时间单调不重叠。
checkfluent-report.json 存在且记录 sourceCueCount、unitCount、targetLanguage、verbosity、outputSubtitlePath;如果输入 glossary,也必须原样记录。