
1738348785/dsh-plugin-text-translation
30最近提交 2026年8月14日
dsh-plugin-text-translation DSH 插件
该插件为 DSH Agent 提供带标签防爆遮罩的文本提取、切片和无损回填组装能力。支持游戏脚本(Mtool JSON、Ren'Py 等)和长文档(PDF、Word、Markdown、HTML、TXT)等多种格式。注册了 extract_text、assemble_text、inspect_text_file 三个工具,供 Agent 编排翻译工作流。
如何安装 dsh-plugin-text-translation DSH 插件
dsh plugin --profile demo add github:1738348785/dsh-plugin-text-translation复制不会执行命令。安装 dsh-plugin-text-translation DSH 插件前请核对仓库和版本。
dsh-plugin-text-translation DSH 插件数据来源
dsh-plugin-text-translation DSH 插件快照日期:2026年8月16日
discovered
dsh-plugin-text-translation DSH 插件能做什么
- 标签防爆遮罩:自动识别并保护 RPG Maker、Unity/RichText、变量占位符和 Ren'Py 标签,翻译后 100% 精确还原。
- 多格式支持:游戏脚本(Mtool JSON、Translator++ XLSX/CSV、Ren'Py .rpy、字幕 SRT/ASS/VTT、Gettext .po)和文档(PDF、.docx、Markdown、HTML、TXT)
- 原生集成 DSH:通过 bundle manifest 安装即用,自动注册三个工具到 profile 的 bundle 层,无需额外配置。
- 可配置选项:通过 cordis.patch.yml 设置 Python 解释器路径(pythonPath)和单批次切片行数(batchSize)。
dsh-plugin-text-translation DSH 插件适合哪些场景
- 翻译带嵌入式标签的游戏脚本(如 RPG Maker、Ren'Py),保持格式和变量完整无损。
- 将长文档切片后,使用 DSH 子代理并行翻译各批次,再调用 assemble_text 无损回填为原始格式。
- 在翻译前使用 inspect_text_file 查看文件格式、条目数和标签分布,辅助制定翻译策略。
- 利用 DSH 的 workflow 和 subagent 工具构建自动化翻译工作流,插件负责提取和装配环节。
- 在游戏本地化 CI 流程中集成,自动提取待翻译文本并在翻译完成后回填。
dsh-plugin-text-translation DSH 插件适合谁
- 需要翻译游戏脚本或复杂格式文档的 DSH 用户。
- 在 DSH 生态中构建翻译工作流或管道的开发者。
dsh-plugin-text-translation DSH 插件的限制
- 插件本身不执行翻译,只负责文本提取和回填;实际翻译需由 DSH Agent 通过子代理或工作流编排。
- 需要 DSH 0.1.0-rc.6 或更高版本环境,且 profile 需安装相关依赖。
- XLSX、PDF、DOCX、HTML 等格式需要额外安装对应的 Python 可选依赖;未安装时仅对应功能报错。
- 本地源码安装在 Windows 下可能因 pnpm 符号链接导致模块解析失败,需手动创建 junction 解决。
dsh-plugin-text-translation DSH 插件的仓库 README 摘录
以下文字摘自 dsh-plugin-text-translation DSH 插件的上游仓库 1738348785/dsh-plugin-text-translation 的 README,版权归原作者,仅作引用。
> **DeepSeek Harness (DSH) 文本与文档翻译插件**:为 DSH Agent 提供**标签防爆遮罩**、 > **多格式文本提取/切片**与**无损回填组装**能力,覆盖游戏脚本与长文档两类场景。 > 翻译本身由 DSH Agent 编排完成——可借助 DSH 内置的 `subagent` / `subagent_fork` / > `workflow` 工具并行翻译各批次,本插件只负责"提取"与"装配"这两个原子环节。 - 📦 GitHub: https://github.com/1738348785/dsh-plugin-text-translation - ✅ 实测环境:DSH `0.1.0-rc.6`(headless 与 web profile 均已验证) --- ## 🌟 核心特性 - 🛡️ **标签防爆遮罩 (Tag Protector)**:自动识别并保护 RPG Maker (`\c[1]`, `\v[1]`, `\n`)、 Unity/RichText (`<color>`, `<b>`)、变量占位符 (`{player}`, `{0}`, `%s`) 与 Ren'Py 标签, 翻译后 **100% 精确无损还原**。 - 📑 **全格式支持**: - **游戏脚本**:Mtool JSON (`ManualTransFile.json`)、Translator++ 表格 (XLSX/CSV)、 Ren'Py (`.rpy`)、字幕 (SRT/ASS/VTT)、Gettext (`.po`)。 - **长文档**:PDF、Word (`.docx`)、Markdown、HTML、TXT。 - 🧩 **原生集成 DSH**: - 导出标准的 `dsh.bundle` Manifest(`dsh.bundle.patch`),随 `dsh plugin` 安装后自动加入 profile 的 bundle 层。 - 注册 `extract_text`、`assemble_text`、`inspect_text_file` 三个工具供 DSH Agent 调度。 - Python 引擎(`python/` 目录)随插件一起分发,安装即用,无外部路径依赖。 --- ## 📦 安装与使用 ### 方式一:从 GitHub 安装(推荐) ```bash dsh plugin --profile demo add github:1738348785/dsh-plugin-text-translation ``` `dsh` 会拉取仓库、自动把插件的 `cordis.patch.yml` 追加进 profile 的 bundle 层。 (GitHub 安装实测
阅读完整 README仓库许可: MIT
dsh-plugin-text-translation DSH 插件常见问题
如何安装这个插件?
运行 `dsh plugin --profile demo add github:1738348785/dsh-plugin-text-translation`。如果要在 Web 界面中管理,需要安装到 web profile 并重启 DSH Web:`dsh plugin --profile web add github:1738348785/dsh-plugin-text-translation`。也支持从本地路径安装:`dsh plugin --profile demo add ./dsh-plugin-text-translation`。
支持哪些文件格式?
游戏脚本:Mtool JSON、Translator++ XLSX/CSV、Ren'Py .rpy、字幕 SRT/ASS/VTT、Gettext .po。长文档:PDF、.docx、Markdown、HTML、TXT。其中 XLSX、PDF、DOCX、HTML 需要安装对应的 Python 可选依赖(openpyxl、PyMuPDF、python-docx、beautifulsoup4)。
插件本身会翻译文本吗?
不会。插件只负责提取文本(带标签保护)和回填翻译结果。实际的翻译工作由 DSH Agent 通过子代理(subagent、subagent_fork)或工作流工具完成。你需要确保 DSH 环境配置了翻译模型或 API key。
如何处理大文件翻译?
使用 `extract_text` 工具,设置 `batch_size` 参数将文件切分为多个批次。然后分别用 DSH 子代理翻译每个批次,将所有翻译结果合并为一个 translations JSON。最后调用 `assemble_text` 传入原始文件和 translations JSON 生成翻译后的文件。
在 Windows 上本地安装时报错 ERR_MODULE_NOT_FOUND 怎么办?
这是 pnpm 符号链接导致的已知问题。插件代码的 ESM 导入会按真实路径解析,导致找不到 profile 的依赖包。解决办法是在插件目录下创建指向 profile node_modules 的 junction。README 中提供了详细的 PowerShell 命令示例。