fix(phone-connect): zh-Hans locale, aliasMap, box padding, volume, config data loss, interval, dead settings, slider, UI issues (#199)

* fix(phone-connect): zh-Hans locale, switcher aliasMap, box padding

- Rename zh_hans -> zh-Hans (plugin.toml value, en.json key) and add
  the missing translations/zh-Hans.json. The zh_hans tag does not match
  BCP 47, so the framework's materialize step dropped the Chinese
  translation file and t() returned raw dot keys in the UI.
- Add missing aliasMap definition in switcher() so the multi-device
  panel no longer errors on aliasMap[id]. Fixes #176.
- Replace ui.box({padding=...}) with ui.row({padding=...}); box does
  not support the padding prop, causing ui-tree warnings on open.

Supersedes #190 (which covers only the aliasMap fix).

* fix(phone-connect): volume quoting, config data loss, interval, dead settings, slider, UI issues

1. media_set_volume: shellQuote the <int32> variant arg (was unquoted,
   shell treated < as redirect; same fix as media_seek).
2. onConfigChanged: track last-applied custom_image/device_alias values
   so unrelated config edits (e.g. language switch) no longer wipe a
   device's image/alias. Seed trackers at init so reload is safe too.
3. state_update_interval=0: return 3600000ms + guard in update() to
   skip auto-refresh, matching the '0 disables' description.
4. Remove 4 dead settings (show_ongoing_media, show_device_placeholder,
   scan_subdirectories, max_recent_images) declared but never read,
   plus orphan recent_images translation keys.
5. Media slider: freeze value during drag via per-device dragState so
   the 1s service refresh doesn't yank the slider back. Also fixes
   onDragEnd seeking to a stale seekPos.
6. Minor: runCli reports cli_failed not no_backend; browse uses runAsync
   not runInTerminal; charging color priority over low-battery; device
   name falls back to d.name; fix comment mismatches.

* chore: bump version to 0.1.1

* fix: use lowercase zh-hans translation key to pass CI validation

CI rejects uppercase in translation keys (zh-Hans). The translation key
and label_key are now lowercase zh-hans, while the file name stays
zh-Hans.json (required by the framework's materialize step) and the
select value stays zh-Hans (used to build the file path).
This commit is contained in:
CSY2569
2026-08-01 08:56:54 -04:00
committed by GitHub
parent efa9d61f4c
commit 16d66a5b18
6 changed files with 237 additions and 157 deletions
+101
View File
@@ -0,0 +1,101 @@
{
"settings": {
"state_update_interval": {
"label": "状态刷新间隔",
"description": "自动刷新设备状态的间隔秒数。0 表示禁用。"
},
"enable_charging_animation": {
"label": "充电高亮",
"description": "设备充电时高亮显示栏部件。"
},
"custom_image": {
"label": "设备头像",
"description": "选中设备后在此设置自定义头像图片。留空恢复默认图标。"
},
"device_alias": {
"label": "设备别名",
"description": "当前选中设备的自定义显示名称。"
},
"language": {
"label": "界面语言",
"description": "显示语言。",
"en": "English",
"zh-hans": "简体中文"
},
"enable_clipboard_action": {
"label": "显示剪贴板操作",
"description": "显示一键发送剪贴板到设备的快捷操作。"
},
"panel_placement": {
"label": "面板弹出方式",
"description": "详情面板的弹出方式。",
"attached": "贴合栏",
"floating": "悬浮居中",
"widget": "部件下方悬浮"
}
},
"status": {
"unavailable": "不可用",
"no_devices": "无设备",
"offline": "离线",
"connected": "已连接",
"not_paired": "未配对",
"no_backend": "KDE Connect 未运行"
},
"action": {
"ring": "响铃",
"ping": "Ping",
"clipboard": "剪贴板",
"share": "分享",
"browse": "浏览",
"sms": "短信",
"pair": "配对",
"accept": "接受",
"reject": "拒绝",
"unpair": "取消配对",
"refresh": "刷新",
"switch": "切换设备"
},
"notify": {
"ringing": "正在响铃 {name}...",
"ping_sent": "已向 {name} 发送 Ping",
"clipboard_sent": "剪贴板已发送",
"pairing_sent": "已发送配对请求",
"paired": "设备已配对",
"unpaired": "设备已取消配对",
"opening_browser": "正在打开文件浏览器...",
"sms_sent": "短信已发送"
},
"error": {
"ring_failed": "响铃失败",
"ping_failed": "发送 Ping 失败",
"clipboard_failed": "发送剪贴板失败",
"share_failed": "分享失败",
"browse_failed": "浏览设备失败",
"pairing_failed": "配对失败",
"accept_failed": "接受配对失败",
"reject_failed": "拒绝配对失败",
"unpair_failed": "取消配对失败",
"no_backend": "无后端",
"cli_failed": "命令失败"
},
"panel": {
"title": "手机连接",
"empty": "未找到设备。请在 KDE Connect 中配对设备。",
"devices_connected": "已连接 {connected} · 已配对 {paired}",
"now_playing": "正在播放",
"no_media": "无媒体播放",
"image_path": "自定义图片",
"sms": "发送短信",
"sms_dest": "手机号码",
"sms_msg": "短信内容",
"sms_send": "发送",
"battery": "电量",
"network": "网络",
"pairing": "配对",
"type": "类型",
"paired": "已配对",
"unpaired": "未配对",
"unknown": "未知"
}
}