bloodtmai-cmyk/dsh-harness-enterprise--packages-client-locale ↗★ 5

@deepseek-ai/dsh-client-locale

语言区域插件:宿主存储的中英偏好、浏览器回退与命名空间词典。 适合需要中英文界面切换与本地化词典的客户端插件,偏好存于宿主设置。

包名
@deepseek-ai/dsh-client-locale
兼容性
待验证
Harness 依赖范围
workspace:^
Cordis 依赖范围
workspace:^
版本
0.1.0-rc.7
许可证
MIT
最近更新
2026年8月20日

同名包的其他仓库

安装

此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗

@deepseek-ai/dsh-client-locale

English | 中文

Locale plugin: LocaleRuntime — the zh/en preference stored as locale.preference in $DSH_HOME/settings.yaml; when that explicit Host value is absent, a fresh browser starts provisionally in the language navigator asks for (primary-subtag matching, with zh when it asks for no language this app ships). The Host read runs after plugin activation so an unavailable settings service cannot block the page; its result replaces the provisional browser value live. Remote browsers retain only a process-local selection because the settings API is loopback-only. locale/change fires on switches. The service also owns the ns×locale dictionary registry (typed register(ns, {zh, en}) checked against LocaleNamespaceMap, bind(ns)→TranslateNS; lookup chain ns → common → zh → key), implements the slot system's LocaleFace, and installs itself through ctx.slots.installLocale, backing the framework-injected t standard seat (Translate/TranslateNS are ui-slots types; import them from there — this package only re-exports for dictionary owners' convenience). The Host-backed preferences decision owns the persistence boundary.

Model Experience

Managed desktop output-language guidance

What the model sees

When the managed desktop host sets DSH_OUTPUT_LANGUAGE_FROM_LOCALE=1, one instruction asks visible reasoning, plans, tool explanations, and final responses to use the latest locale.preference. Code, commands, identifiers, file paths, and quoted source text retain their original language. The default composition registers no model instruction.

Token effect

One fixed two-sentence system-prompt paragraph is present in managed desktop requests. It does not add a tool schema, tool result, or per-Turn context entry.

KV Cache effect

The instruction is stable while the language does not change. A hot switch changes the system prompt for the next model step, so that request cannot reuse the complete prompt prefix from before the switch.

Known Limitations and Deferred Work

  • Some surfaces keep inline copy — Settings rows, the sidebar, question composer, and model select use locale seats; other packages still own static text directly.
  • Registry-held text reads its translation once — copy captured at registration time outside the slot render path (e.g. the /model command description in the command registry) keeps the language it was registered under until re-registration; slot-rendered copy follows switches live.