From ebe86663b1cf253494a67d858a3c72188b54ffee Mon Sep 17 00:00:00 2001 From: jim800121chen Date: Sun, 12 Apr 2026 19:11:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(local-tool):=20i18n=20type=20error=20?= =?UTF-8?q?=E2=80=94=20=E7=94=A8=20devices.status.connecting/disconnecting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit devices.connecting / devices.disconnecting 不在 TranslationDict type 裡, 改用已存在的 devices.status.connecting + 新增 devices.status.disconnecting。 刪掉上一個 commit 多加的頂層 devices.connecting / disconnecting key。 Co-Authored-By: Claude Opus 4.6 (1M context) --- local-tool/frontend/src/components/devices/device-card.tsx | 4 ++-- local-tool/frontend/src/lib/i18n/en.ts | 5 ++--- local-tool/frontend/src/lib/i18n/types.ts | 1 + local-tool/frontend/src/lib/i18n/zh-TW.ts | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/local-tool/frontend/src/components/devices/device-card.tsx b/local-tool/frontend/src/components/devices/device-card.tsx index 23fa743..4f88bec 100644 --- a/local-tool/frontend/src/components/devices/device-card.tsx +++ b/local-tool/frontend/src/components/devices/device-card.tsx @@ -70,7 +70,7 @@ export function DeviceCard({ device, isFirstCard }: DeviceCardProps) { onClick={() => disconnectDevice(device.id)} > {isDisconnecting && } - {isDisconnecting ? t('devices.disconnecting') : t('common.disconnect')} + {isDisconnecting ? t('devices.status.disconnecting') : t('common.disconnect')} ) : ( @@ -81,7 +81,7 @@ export function DeviceCard({ device, isFirstCard }: DeviceCardProps) { {...(isFirstCard ? { 'data-tour-id': 'connect-device-btn' } : {})} > {isConnecting && } - {isConnecting ? t('devices.connecting') : t('common.connect')} + {isConnecting ? t('devices.status.connecting') : t('common.connect')} )} diff --git a/local-tool/frontend/src/lib/i18n/en.ts b/local-tool/frontend/src/lib/i18n/en.ts index 8ca879a..e2e7c2b 100644 --- a/local-tool/frontend/src/lib/i18n/en.ts +++ b/local-tool/frontend/src/lib/i18n/en.ts @@ -67,16 +67,15 @@ export const en: TranslationDict = { subtitle: 'Manage your edge AI devices', scan: 'Scan Devices', scanning: 'Scanning...', - connecting: 'Connecting...', - disconnecting: 'Disconnecting...', noDevices: 'No devices detected. Make sure mock mode is enabled or connect a device.', type: 'Type', firmware: 'Firmware', flashedModel: 'Flashed Model', status: { detected: 'Detected', - connecting: 'Connecting', + connecting: 'Connecting...', connected: 'Connected', + disconnecting: 'Disconnecting...', flashing: 'Flashing', inferencing: 'Inferring', error: 'Error', diff --git a/local-tool/frontend/src/lib/i18n/types.ts b/local-tool/frontend/src/lib/i18n/types.ts index 837398d..03066ef 100644 --- a/local-tool/frontend/src/lib/i18n/types.ts +++ b/local-tool/frontend/src/lib/i18n/types.ts @@ -73,6 +73,7 @@ export interface TranslationDict { detected: string; connecting: string; connected: string; + disconnecting: string; flashing: string; inferencing: string; error: string; diff --git a/local-tool/frontend/src/lib/i18n/zh-TW.ts b/local-tool/frontend/src/lib/i18n/zh-TW.ts index f76d596..d9a2de3 100644 --- a/local-tool/frontend/src/lib/i18n/zh-TW.ts +++ b/local-tool/frontend/src/lib/i18n/zh-TW.ts @@ -67,16 +67,15 @@ export const zhTW: TranslationDict = { subtitle: '管理你的 Edge AI 裝置', scan: '掃描裝置', scanning: '掃描中...', - connecting: '連線中...', - disconnecting: '斷線中...', noDevices: '未偵測到裝置。請確認已啟用 Mock 模式或連接裝置。', type: '類型', firmware: '韌體', flashedModel: '已燒錄模型', status: { detected: '已偵測', - connecting: '連線中', + connecting: '連線中...', connected: '已連線', + disconnecting: '斷線中...', flashing: '燒錄中', inferencing: '推論中', error: '錯誤',