dsh-language-guard
Lock model reasoning and replies to a target language in DeepSeek Harness (Simplified Chinese by default): three strength levels, configurable prompt sections, periodic reminders, a settings panel with a quick language switch. 适合需要强制模型用特定语言(如中文)回答,防止其中途跑调的用户。
インストール
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:58fly/dsh-language-guardドキュメント
README 全文を読む ↗Configuration
Seven fields, all volatile (a change takes effect immediately — no restart, no plugin remount):
| Field | Type | Default | Range | Description |
|---|---|---|---|---|
languageMode | "" | "auto" | "manual" | "" | tri-state enum, case-sensitive | Language mode. "auto" follows the interface language, "manual" pins targetLanguage, "" means "never chosen" and is resolved by the migration rule below |
targetLanguage | string | "zh-CN" | a valid BCP-47 tag (/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/) | Target language. zh-CN Simplified Chinese, zh-TW Traditional Chinese, en English, ja Japanese, ko Korean; any other valid tag is used as-is |
strength | "B" | "C" | "D" | "C" | enum, case-sensitive | Strength level, see above |
injectEveryNRounds | number | 8 | 3–50, integer | How often the Periodic self-check is added. Only used at D; the control is disabled at other levels |
preserveCodeTerms | boolean | true | true / false | true: code, commands, paths, identifiers, API fields and raw error text stay verbatim. false: technical terms are preferred in the target language, with the English term in parentheses when needed |
extraRules | string | "" | any text | Appended after the built-in rules. Empty means built-in rules only |
overrideHead | string | "" | any text | Replaces the built-in opening text entirely (extraRules is still appended after it). Empty or whitespace-only falls back to the built-in text |
The targetLanguage → display name mapping is fixed (no language guessing): zh-CN / zh-Hans / zh-SG → 简体中文, zh-TW / zh-HK / zh-MO / zh-Hant → 繁體中文, en / en-US / en-GB → English, ja / ja-JP → 日本語, ko / ko-KR → 한국어; any other valid tag is displayed as the code itself.
Configuration lives in the profile's cordis.patch.yml. A patch replaces config wholesale — it does not deep-merge — so a manual override must restate every field, otherwise the omitted ones are lost:
- id: dsh-language-guard
name: dsh-language-guard
config:
languageMode: auto
targetLanguage: zh-CN
strength: C
injectEveryNRounds: 8