diff --git a/dist/dsh-watch-0.1.0.tgz b/dist/dsh-watch-0.1.0.tgz index 86c3858..fa8fe09 100644 Binary files a/dist/dsh-watch-0.1.0.tgz and b/dist/dsh-watch-0.1.0.tgz differ diff --git a/lib/client.js b/lib/client.js index d2e4b93..6b71bbe 100644 --- a/lib/client.js +++ b/lib/client.js @@ -84,19 +84,40 @@ window.__ModuleLoader__.load({ // 注入:连接 API 等 const inject = ["slots", "locale", "connection", "remote", "settingsScope"]; + // 文案 + const zh = { + nav: "DSHWatch 设置", + title: "DSHWatch 设置", + desc: "手机/手表远程控制 DeepSeek Harness 的配置。", + save: "保存", + saved: "已保存 ✓", + loading: "加载中…", + readErr: "读取失败", + saveErr: "保存失败" + }; + const en = { + nav: "DSHWatch Settings", + title: "DSHWatch Settings", + desc: "Config for remote-controlling this Harness from DSHWatch phone/watch.", + save: "Save", + saved: "Saved ✓", + loading: "Loading…", + readErr: "Failed to read", + saveErr: "Failed to save" + }; + function apply(ctx) { - ctx.inject(["slots", "locale", "connection", "remote", "settingsScope"], (scope) => { - const api = scope.get("connection").api; - const injected = () => ({ api }); - scope.slots.register({ - name: "settings.section", - id: "dsh-watch", - order: 30, - label: () => "DSHWatch 设置", - locale: "dsh-watch.settings", - inject: injected - }, Section); - }); + ctx.locale.register("dsh-watch.settings", { zh, en }); + const { api } = ctx.get("connection"); + const injected = () => ({ api }); + ctx.slots.inject("settings.section", () => ctx.slots.register({ + name: "settings.section", + id: "dsh-watch", + order: 30, + label: () => ctx.locale.bind("dsh-watch.settings")("nav"), + locale: "dsh-watch.settings", + inject: injected + }, Section)); } exports.apply = apply;