@laraveladmin/dsh-stay-awake 0.4.2 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # 变更记录 · Changelog
2
2
 
3
+ ## 0.5.1 — 2026-12-06
4
+
5
+ ### 改进
6
+
7
+ - 界面语言下拉的选项改为 **`母语名(当前界面语言里的名称)`**,与 hyperf-admin 的 LocaleSwitch 口径一致:
8
+ 中文界面显示 `English(英语)`、英文界面显示 `简体中文(Simplified Chinese)`;翻译后名称与母语名相同时不重复括注。
9
+ - 新增 `i18n/language-names.json`:**19×19 全量语言名称对照表**(复用 hyperf-admin `common.locales` 的 17×17,
10
+ 补齐荷兰语、波兰语、泰语),构建脚本生成 `LANGUAGE_NAMES`;「跟随 DSH · <语言>」里的语言名也按同样规则本地化。
11
+ - 新增 1 项测试(名称表 19×19 完整无空值 + 客户端内嵌与渲染函数),单测 131 → **132 全绿**。
12
+ - 纯客户端改动,刷新页面即可生效,无需重启宿主。
13
+
14
+
15
+ ## 0.5.0 — 2026-12-06
16
+
17
+ ### 新功能:界面语言选择器
18
+
19
+ - 弹层新增「**界面语言**」选择(开关区最后一行,原生 select):默认「跟随 DSH」,也可单独选一种语言
20
+ 覆盖——**只影响插件自身文案**,DSH 其余界面不变;选择写入 `state.json` 持久化,选回「跟随 DSH」恢复自动。
21
+ - 语言列表扩到 **19 种**(新增**泰语 ไทย**;与 hyperf-admin 项目的 17 种对齐,并保留插件已有的荷兰语、波兰语):
22
+ 简体中文、繁體中文、English、日本語、한국어、Deutsch、Español、Français、Italiano、Português、Русский、
23
+ Nederlands、Polski、Türkçe、ไทย、हिन्दी、Bahasa Indonesia、Tiếng Việt、العربية。
24
+ - 语言解析引入别名表(`zh-CN/zh-Hans→zh`、`zh-TW/zh-HK→zh-Hant`,其余按前缀),未知回退英文;
25
+ 每语言 54 → **56 条**文案(新增「界面语言」「跟随 DSH」)。
26
+ - 文字方向跟随**生效语言**:覆盖成阿拉伯语时弹层立即 RTL。
27
+ - 插件不再向 DSH 全局语言菜单贡献语言项、也不再向共享 locale 注册字典——语言完全由弹层自己管理。
28
+ - 宿主协议升到 **4**:旧宿主时语言选择器禁用并提示重载。
29
+ - 新增/更新 5 项测试(别名字表唯一性与 zh-CN/zh-TW 映射、语言配置校验、state 往返、服务端 `set-language`
30
+ 与回包、泰语键集合),单测 126 → **131 全绿**。
31
+ - 0.4.1(RTL)与 0.4.2(开关圆点居中)未单独发布,一并包含在本版;npm 上从 0.4.0 直接到 0.5.0。
32
+
33
+
3
34
  ## 0.4.2 — 2026-12-06
4
35
 
5
36
  ### 修复
package/README.en.md CHANGED
@@ -180,6 +180,7 @@ Override the row by id in the profile's `cordis.patch.yml`:
180
180
  questionSound: '' # custom "your turn" sound file (absolute path)
181
181
  questionRepeatSeconds: 20 # repeat the cue while unanswered, 0 = once
182
182
  questionRepeatMaxMinutes: 10 # longest repeat window
183
+ language: null # interface language override, null = follow DSH
183
184
  questionPollMs: 1500 # how often pending human input is checked
184
185
  soundVolume: 1 # 0-3, macOS/Linux
185
186
  successSound: '' # custom completion file (absolute path)
@@ -262,6 +263,18 @@ systemd-inhibit --list
262
263
 
263
264
  **Local writes and network**: exactly one state file, `~/.dsh/plugin-data/dsh-stay-awake/state.json` (the panel preferences). It does not modify system power plans, request privileges, read session content, or use the network for update checks. The one outbound action is the **TCP reachability probe** (default `api.deepseek.com:443`, handshake only, no data) while Retry after reconnect is enabled; turning that toggle off stops it.
264
265
 
266
+ ## Interface language
267
+
268
+ The panel has an **Interface language** selector as its last switch-section row:
269
+
270
+ - **Follow DSH** is the default: the plugin follows the DSH locale and the option shows the current one (`Follow DSH · 日本語`).
271
+ - Picking a language **overrides** it for this plugin only — the rest of DSH keeps its own locale. The choice applies immediately and is stored in `~/.dsh/plugin-data/dsh-stay-awake/state.json`, so it survives refreshes and restarts.
272
+ - Picking "Follow DSH" again restores the automatic behaviour.
273
+ - Each option reads `native(current interface language)`, e.g. `English(英语)` in a Chinese UI and `简体中文(Simplified Chinese)` in an English one; the names live in `i18n/language-names.json` (full 19×19 table, aligned with hyperf-admin's `common.locales` and extended with Dutch/Polish/Thai).
274
+ - The list comes from `i18n/<locale>.json` and ships **19 languages**: Simplified and Traditional Chinese, English, Japanese, Korean, German, Spanish, French, Italian, Portuguese, Russian, Dutch, Polish, Turkish, Thai, Hindi, Indonesian, Vietnamese and Arabic.
275
+ - `zh-CN / zh-Hans → Simplified`, `zh-TW / zh-HK → Traditional`, other locales match by language prefix, unknown ones fall back to English.
276
+ - Text direction follows the **effective** language: overriding to Arabic flips the panel to RTL even while the rest of DSH stays LTR.
277
+
265
278
  ## Internationalization
266
279
 
267
280
  - The indicator, the panel and the plugin-manager copy follow the active DSH locale and ship **18 languages**: Simplified Chinese, Traditional Chinese, English, Japanese, Korean, German, Spanish, French, Italian, Portuguese, Russian, Dutch, Polish, Turkish, Hindi, Indonesian, Vietnamese and Arabic.
package/README.md CHANGED
@@ -181,6 +181,7 @@ DSH 默认不带任何索引源。添加本项目随 npm 包发布的索引文
181
181
  questionSound: '' # 自定义「提醒」音文件(绝对路径)
182
182
  questionRepeatSeconds: 20 # 未回答时每隔多久再响一次,0 = 只响一次
183
183
  questionRepeatMaxMinutes: 10 # 最多重复多久
184
+ language: null # 界面语言覆盖,null = 跟随 DSH(弹层里改)
184
185
  questionPollMs: 1500 # 多久查一次「是否在等你回答」
185
186
  soundVolume: 1 # 0~3,macOS/Linux 生效
186
187
  successSound: '' # 自定义完成音文件(绝对路径)
@@ -265,6 +266,21 @@ systemd-inhibit --list
265
266
 
266
267
  **本地写入与网络**:只写一个状态文件 `~/.dsh/plugin-data/dsh-stay-awake/state.json`(弹层里的偏好),不碰系统电源计划、不申请提权、不读取会话内容、不联网检查更新。唯一的外发动作是开启「断网自动重试」后对配置的主机做 **TCP 连接探测**(默认 `api.deepseek.com:443`,只建连、不发送任何数据);关掉该开关即停止。
267
268
 
269
+ ## 界面语言
270
+
271
+ 弹层里新增「**界面语言**」选择器(开关区最后一行):
272
+
273
+ - **默认「跟随 DSH」**:DSH 切换语言时插件自动跟着切,选项后面会显示当前 DSH 语言(如「跟随 DSH · 日本語」)。
274
+ - 也可以单独选一种语言**覆盖**:只影响「守夜」自己的文案,DSH 其余界面不变;切换立即生效并写入
275
+ `~/.dsh/plugin-data/dsh-stay-awake/state.json`,刷新/重启后保留。
276
+ - 选回「跟随 DSH」即恢复自动跟随。
277
+ - 下拉选项按 `母语名(当前界面语言里的名称)` 显示,例如中文界面下是 `English(英语)`、英文界面下是 `简体中文(Simplified Chinese)`;名称数据在 `i18n/language-names.json`(19×19 全量,参考 hyperf-admin 的 `common.locales` 口径并补齐荷兰语/波兰语/泰语)。
278
+ - 语言列表来自 `i18n/<locale>.json`,共 **19 种**:简体中文、繁體中文、English、日本語、한국어、Deutsch、
279
+ Español、Français、Italiano、Português、Русский、Nederlands、Polski、Türkçe、ไทย、हिन्दी、Bahasa Indonesia、
280
+ Tiếng Việt、العربية。
281
+ - 浏览器/DSH 报告的 `zh-CN / zh-Hans → 简体`、`zh-TW / zh-HK → 繁體`,其余按语言前缀匹配,未知语言回退英文。
282
+ - 文字方向跟随**生效语言**:覆盖成阿拉伯语时,弹层立即切成 RTL,不必把 DSH 也切成阿语。
283
+
268
284
  ## 多语言
269
285
 
270
286
  - 状态栏指示器、弹层与插件管理器文案跟随 DSH 当前语言,内置 **18 种语言**:简体中文、繁體中文、English、日本語、한국어、Deutsch、Español、Français、Italiano、Português、Русский、Nederlands、Polski、Türkçe、हिन्दी、Bahasa Indonesia、Tiếng Việt、العربية。