dsh-plugin-text-translation: DSH Text and Document Translation Plugin

Preface

In the DSH plugin ecosystem, text translation cannot rely solely on the model directly processing raw files. Game scripts commonly contain colors, line breaks, and variable placeholders, while subtitles and long documents often have many entries. Direct translation can easily break structures such as \c[1], {player}, and SRT timestamps.

dsh-plugin-text-translation provides a set of schedulable tools for the DSH Agent: first inspect the file, then extract translatable text while masking tags, and finally write the translation results back losslessly into the original format. Translation orchestration is still handled by the DSH Agent, while the plugin handles extraction and assembly.

What This Is

dsh-plugin-text-translation is a text and document translation plugin for DeepSeek Harness (DSH), with repository owner 1738348785, MIT license, and package.json version 1.0.0.

It targets game script and long document localization, providing tag-protection masking, multi-format text extraction/chunking, and lossless backfill assembly capabilities. It has been tested with DSH 0.1.0-rc.6, and both headless and web profiles have been verified.

It is not a complete translation system: the translation itself is orchestrated by the DSH Agent and can work with DSH subagent / subagent_fork / workflow for parallel translation batches; the plugin handles the extraction and assembly stages.

Core Features

Tag-Protection Masking

The plugin automatically identifies and protects common localization tags and placeholders, restoring them after translation:

  • RPG Maker: \c[1], \v[1], \n
  • Unity/RichText: <color>, <b>
  • Variable placeholders: {player}, {0}, %s
  • Ren’Py tags

Supported Formats

Game scripts:

  • Mtool JSON
  • Translator++ XLSX/CSV
  • Ren’Py .rpy
  • SRT/ASS/VTT subtitles
  • Gettext .po

Long documents:

  • PDF
  • Word .docx
  • Markdown
  • HTML
  • TXT

DSH Integration

  • Registers three tools: inspect_text_file, extract_text, and assemble_text.
  • Exports a dsh.bundle Manifest, which is added to the profile’s bundle layer when installed via dsh plugin.
  • The Python engine is distributed with the plugin and works out of the box without external path dependencies.
  • If optional dependencies are not installed, only the corresponding format or standalone LLM pipeline features will error; all other functionality remains unaffected.

Runtime peerDependencies include:

{
  "@deepseek-ai/cordis": "^4.0.1",
  "@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
  "@deepseek-ai/schemastery": "^3.18.1"
}

Installation and Activation

Installing from GitHub

First confirm the target profile is available, then run:

dsh plugin --profile demo add github:1738348785/dsh-plugin-text-translation

After installation, the plugin will be added to the current profile’s bundle layer.

Installing to the Web Profile

To see the plugin in the web profile, install it to web:

dsh plugin --profile web add github:1738348785/dsh-plugin-text-translation

Then restart the web service and refresh the page.

Local Source Installation

For local source installation or development debugging, you can use the current directory:

dsh plugin --profile demo add ./dsh-plugin-text-translation

Local path installation may cause ERR_MODULE_NOT_FOUND due to pnpm symlinks/junctions and Node ESM real-path resolution. On Windows, the dependency tree must be exposed to the plugin directory via a junction.

Quick Debugging Without Installation

You can also load only the plugin’s patch layer for quick debugging:

dsh --profile demo --patch ./dsh-plugin-text-translation/cordis.patch.yml

Notes for Initializing a New Profile

When installing the plugin into a new profile for the first time, you may encounter the following two DSH environment issues.

  1. The npm registry latest tag may incorrectly point to the old 0.0.1-rc.1 version of @deepseek-ai/dsh-base. You need to explicitly specify 0.1.0-rc.6.
  2. pnpm 11 blocks dependency build scripts by default. If you encounter ERR_PNPM_IGNORED_BUILDS, set allowBuilds to true in pnpm-workspace.yaml.

Typical Usage

  1. Call inspect_text_file to check the file format, entry count, speaker, and tag distribution.
  2. Call extract_text to extract translatable text; you can pass output_json and batch_size to save chunked JSON.
  3. Have the DSH Agent translate the batches, optionally using subagent, subagent_fork, or workflow for parallel processing.
  4. Call assemble_text to write translations_json back losslessly to the format of original_file.

Use Cases and Considerations

Suitable for developers working with game scripts, subtitles, PDFs, Word, Markdown, and other localization files within DSH.

Notes:

  • This plugin only handles extraction and assembly; it does not replace the translation model or translation strategy.
  • The plugin runs with the permissions of the current dsh process; review the source code, dependencies, and MIT license before installation.
  • If optional dependencies are not installed, only the corresponding format or standalone LLM pipeline features will error; all other functionality remains unaffected.
  • When initializing a new profile, it is recommended to check the @deepseek-ai/dsh-base version and pnpm build scripts settings as described above.

Conclusion

The value of dsh-plugin-text-translation lies in separating the most error-prone parts of the localization workflow—“tag protection, chunking, and backfill”—from the model’s task, allowing the DSH Agent to reliably process game scripts and long documents.

GitHub repository:

https://github.com/1738348785/dsh-plugin-text-translation

Plugin directory page reference:

https://www.skillhub.cn/plugins/1738348785/dsh-plugin-text-translation

This directory page URL comes from plugin metadata and is not presented as verified fact.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye