Files
deepseek-harness/packages/client/locale
Tianyi Cui 9ebda8755e Merge remote-tracking branch 'origin/master' into worktree/localize-ui-strings-gate
# Conflicts:
#	packages/client/ui-chat/src/client/chat/AssistantMarkdown.tsx
#	packages/client/ui-chat/src/client/chat/CompactionItem.tsx
#	packages/client/ui-conversation/src/client/locales.ts
#	packages/client/ui-renderer/src/client/app.tsx
#	packages/client/ui-renderer/src/client/index.ts
#	packages/client/ui-renderer/tests/ui-renderer.client.spec.tsx
#	packages/client/ui-tool/src/client/tool/models/tool-call-model.ts
#	packages/client/ui-trajectory/src/client/trajectory-record.ts
#	packages/client/ui-trajectory/src/client/trajectory-snapshot-builder.ts
#	packages/client/ui-trajectory/tests/views.client.spec.tsx
#	packages/client/ui-workspace/src/client/tree.ts
2026-08-23 18:34:42 +08:00
..

@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 en 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, and the plugin points <html lang> at the active locale (zh-CN/en) on activation and on every switch. The service also owns the ns×locale dictionary registry (typed register(ns, {zh, en}) checked against LocaleNamespaceMap, bind(ns)TranslateNS<ns>; lookup chain ns → common → en → 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). Product-authored Client UI text must enter through these typed dictionaries or an already-localized primitive prop; verify-client-ui-i18n enforces that source ownership (decision). The Host-backed preferences decision owns the persistence boundary.

Model Experience

None, as the locale registry serves browser UI copy; nothing here reaches a model request.

KV Cache effect

None; this package neither assembles nor sends a provider request.

Known Limitations and Deferred Work

  • 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.