Introduction¶
If you are using DSH (DeepSeek Harness), you have likely seen these English interfaces: the descriptions of each command in the command menu, the permission preset descriptions, the review buttons in plan mode, and the labels in the trajectory view. They are not copy that can be changed via configuration options, but hardcoded English strings inside the package files, for which the official version does not provide i18n override points. If you want to switch to Chinese, you have to modify the package files directly—while this works, once DSH is upgraded, the patch is lost, and you have to do it all over again.
Community author lingyingaojue turned this manual process into a plugin called dsh-l10n-hardpatch: after installation, restarting DSH Web automatically localizes it; when an upgrade causes English to return, restarting automatically reapplies the patch. Below is an introduction to its implementation and usage.
What is this¶
dsh-l10n-hardpatch is a local directory-type bundle plugin designed as a “hardcoded localization patch”: when the plugin loads, it replaces known hardcoded English lines in various DSH packages with their corresponding Chinese lines line-by-line. It is licensed under MIT.
It does not add new features or change interactions; it solves one thing: making the hardcoded English UI strings inside DSH packages display in Chinese and automatically restoring this state after DSH upgrades.
How it works¶
The plugin registers via DSH’s bundle patch mechanism (cordis.patch.yml → insert). Upon loading, it reads patches.json and performs precise line-by-line replacements on candidate bundle files. patches.json contains a total of 144 sets of “original English line → Chinese line” replacement pairs, automatically generated by extract_lines.py from a line-by-line diff between the original npm packages and the localized files. These can be regenerated to adapt to new versions.
The replacement is idempotent, with rules covering three scenarios:
- File already contains the target Chinese line → Skip
- File contains the original English line → Replace with Chinese line
- No match → Keep unchanged
Core Features and Localization Scope¶
According to the README, the plugin has four key highlights:
- Instant localization upon import: Takes effect after restarting DSH Web
- Automatic re-patching: When DSH upgrades cause English to return, restarting automatically re-localizes
- Comprehensive coverage: Simultaneously scans the global npm dependency tree and various levels of
node_modulesin~/.dsh/profiles(including pnpm store layout) to hit the actually loaded files - Safe: Line-by-line precise replacement, avoiding damage to code logic; syntax validation passes after replacement; any exceptions only trigger warnings and do not block plugin loading
The localization scope covers the following packages:
| Package | Content |
|---|---|
dsh-command-compact |
Compressed conversation command descriptions |
dsh-command-feedback |
Feedback command descriptions |
dsh-command-goal |
Goal command descriptions |
dsh-session-log-export |
Export session command descriptions |
dsh-permission-presets |
Permission preset descriptions |
dsh-plan-mode |
Plan review buttons (Approve / Continue Planning, etc.) |
dsh-client-ui-trajectory |
Trajectory view UI labels (approx. 100 places) |
There is one location that does not need patching: the Chinese for the advisor preset and client-connection are built-in with the official rc.7.
Installation and Enablement¶
This is a local directory-type bundle plugin. You need to download the files locally first, then let DSH reference that directory.
- Download the plugin, choose either method:
# Method A: git clone
git clone https://github.com/lingyingaojue/dsh-l10n-hardpatch
# Method B: GitHub page Code → Download ZIP, extract to any directory
- Install to DSH, replacing
<path>with the directory you downloaded or extracted:
dsh plugin --profile web add <path>\dsh-l10n-hardpatch
- Restart DSH Web, and localization takes effect. You can also do this via Web UI Settings → Plugins → Add Local Plugin → Select Directory.
A Known Issue¶
dsh plugin add may fail with exit code 1 due to pnpm’s ERR_PNPM_IGNORED_BUILDS (e.g., @jackwener/opencli, node-pty). In this case, the dependencies are actually installed, but dsh.profile.bundles in package.json is not updated, so the plugin will not be loaded.
Solution: Manually add the package name to the dsh.profile.bundles array, then restart.
Update and Maintenance¶
After DSH upgrades, if some English strings change, the corresponding replacement pairs will become invalid. Steps to regenerate replacement pairs:
# 1. Download the original package for the corresponding version
npm pack @deepseek-ai/dsh-client-ui-trajectory@<version>
# 2. Run the extraction script (requires configuring paths)
python extract_lines.py
# 3. Replace patches.json and restart DSH Web
Applicable Scenarios and Notes¶
Suitable for two types of people: users who want to see a Chinese interface in DSH Web and are willing to accept direct string replacement in packages; and developers who maintain DSH customizations and want to avoid manually editing package files after every upgrade.
Two points need to be clear before use:
-
When the plugin loads, it modifies files inside DSH packages (line-by-line replacement plus syntax validation) and runs with the permissions of the current DSH process. It is recommended to browse the source code before installation to confirm the replacement pairs meet expectations before deciding to load the plugin.
-
It replaces hardcoded strings, not the official i18n solution. When English strings change in future DSH versions, you need to regenerate replacement pairs according to the previous section. The plugin itself is licensed under MIT.
Summary¶
dsh-l10n-hardpatch turns the repetitive labor of “manually editing package files → doing it all over after an upgrade” into an automatic process during plugin loading: idempotent replacement, exceptions only trigger warnings, and automatic re-patching after upgrades. If you are troubled by the hardcoded English in the DSH interface like I was, you can try it using the steps above.
- GitHub: https://github.com/lingyingaojue/dsh-l10n-hardpatch
- Community Directory: https://www.skillhub.cn/plugins/lingyingaojue/dsh-l10n-hardpatch
The community directory is an independent site and has no official affiliation with DeepSeek / Hypersphere.