From 67df8be6d908f20c9e5e010b485af65e30388aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E4=B8=AB=E8=AE=B2=E6=A2=B5?= Date: Mon, 20 Jul 2026 01:23:59 +0800 Subject: [PATCH] feat(i18n): localize Redis dashboard --- .../src/components/redis/RedisDashboard.vue | 49 +++++++++++++------ apps/desktop/src/i18n/locales/en.ts | 29 +++++++++++ apps/desktop/src/i18n/locales/es.ts | 49 +++++++++++++++++++ apps/desktop/src/i18n/locales/it.ts | 49 +++++++++++++++++++ apps/desktop/src/i18n/locales/ja.ts | 49 +++++++++++++++++++ apps/desktop/src/i18n/locales/pt-BR.ts | 49 +++++++++++++++++++ apps/desktop/src/i18n/locales/zh-CN.ts | 49 +++++++++++++++++++ apps/desktop/src/i18n/locales/zh-TW.ts | 49 +++++++++++++++++++ 8 files changed, 358 insertions(+), 14 deletions(-) diff --git a/apps/desktop/src/components/redis/RedisDashboard.vue b/apps/desktop/src/components/redis/RedisDashboard.vue index ce67a274a..58d56a637 100644 --- a/apps/desktop/src/components/redis/RedisDashboard.vue +++ b/apps/desktop/src/components/redis/RedisDashboard.vue @@ -48,6 +48,22 @@ const searchQuery = ref(""); const collapsedSections = ref>(new Set()); const autoRefreshInterval = ref(0); // 0 = off, 5, 10, 30, 60 (seconds) +const infoSectionI18nKeys: Record = { + Server: "redis.dashboard.sections.server", + Clients: "redis.dashboard.sections.clients", + Memory: "redis.dashboard.sections.memory", + Persistence: "redis.dashboard.sections.persistence", + Stats: "redis.dashboard.sections.stats", + Replication: "redis.dashboard.sections.replication", + CPU: "redis.dashboard.sections.cpu", + Modules: "redis.dashboard.sections.modules", + Commandstats: "redis.dashboard.sections.commandstats", + Errorstats: "redis.dashboard.sections.errorstats", + Latencystats: "redis.dashboard.sections.latencystats", + Cluster: "redis.dashboard.sections.cluster", + Keyspace: "redis.dashboard.sections.keyspace", +}; + let refreshTimer: ReturnType | null = null; // --------------------------------------------------------------------------- @@ -228,6 +244,11 @@ function isCollapsed(name: string): boolean { return collapsedSections.value.has(name); } +function infoSectionTitle(name: string): string { + const key = infoSectionI18nKeys[name]; + return key ? t(key) : name; +} + // --------------------------------------------------------------------------- // Auto-refresh // --------------------------------------------------------------------------- @@ -286,7 +307,7 @@ function copyToClipboard(text: string) { navigator.clipboard .writeText(text) .then(() => { - toast("Copied", 1500); + toast(t("redis.copied"), 1500); }) .catch(() => { // Fallback for environments without clipboard API @@ -318,7 +339,7 @@ function copyEntryValue(entry: InfoEntry) {
- Node: + {{ t("redis.dashboard.node") }}: +
@@ -452,7 +473,7 @@ function copyEntryValue(entry: InfoEntry) { @@ -472,8 +493,8 @@ function copyEntryValue(entry: InfoEntry) {
- No matching indicators - No data available + {{ t("redis.dashboard.noMatchingIndicators") }} + {{ t("redis.dashboard.noDataAvailable") }}
diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.ts index cc5f04120..e7e003900 100644 --- a/apps/desktop/src/i18n/locales/en.ts +++ b/apps/desktop/src/i18n/locales/en.ts @@ -2593,6 +2593,35 @@ export default { slowlogColumnClientName: "Client Name", slowlogTotal: "{count} entries", slowlogDetailTitle: "Slow Log Entry #{id}", + dashboard: { + totalMemory: "Total Memory", + usedMemory: "Used Memory", + operations: "Operations", + hitRatio: "Hit Ratio", + keyCount: "Key Count", + clients: "Clients", + searchIndicators: "Search indicators...", + node: "Node", + off: "Off", + refresh: "Refresh", + noMatchingIndicators: "No matching indicators", + noDataAvailable: "No data available", + sections: { + server: "Server", + clients: "Clients", + memory: "Memory", + persistence: "Persistence", + stats: "Stats", + replication: "Replication", + cpu: "CPU", + modules: "Modules", + commandstats: "Command Stats", + errorstats: "Error Stats", + latencystats: "Latency Stats", + cluster: "Cluster", + keyspace: "Keyspace", + }, + }, }, mongo: { documents: "{count} documents", diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.ts index 5e8d9db24..6880fb156 100644 --- a/apps/desktop/src/i18n/locales/es.ts +++ b/apps/desktop/src/i18n/locales/es.ts @@ -2442,6 +2442,35 @@ export default withEnglishFallback({ slowlogColumnClientName: "Nombre del cliente", slowlogTotal: "{count} entradas", slowlogDetailTitle: "Entrada de Slow Log #{id}", + dashboard: { + totalMemory: "Memoria total", + usedMemory: "Memoria utilizada", + operations: "Operaciones", + hitRatio: "Tasa de aciertos", + keyCount: "Cantidad de claves", + clients: "Clientes", + searchIndicators: "Buscar indicadores...", + node: "Nodo", + off: "Desactivado", + refresh: "Actualizar", + noMatchingIndicators: "No hay indicadores coincidentes", + noDataAvailable: "No hay datos disponibles", + sections: { + server: "Servidor", + clients: "Clientes", + memory: "Memoria", + persistence: "Persistencia", + stats: "Estadísticas", + replication: "Replicación", + cpu: "CPU", + modules: "Módulos", + commandstats: "Estadísticas de comandos", + errorstats: "Estadísticas de errores", + latencystats: "Estadísticas de latencia", + cluster: "Clúster", + keyspace: "Espacio de claves", + }, + }, }, mongo: { documents: "{count} documentos", @@ -4636,6 +4665,26 @@ export default withEnglishFallback({ commandChart: "Comandos por segundo", rawStatus: "Variables de estado", filterStatus: "Filtrar variables de estado", + tps: "Transacciones por segundo", + activeQueries: "Consultas activas", + cacheHit: "Tasa de aciertos de caché", + deadlocks: "Interbloqueos", + tempFiles: "Archivos temporales", + walRate: "Tasa de WAL", + commit: "Confirmaciones", + rollback: "Reversiones", + total: "Total", + active: "Activas", + idle: "Inactivas", + fetched: "Obtenidas", + returned: "Devueltas", + read: "Lecturas", + hits: "Aciertos", + serverSessionsChart: "Sesiones del servidor", + transactionsChart: "Transacciones por segundo", + tuplesInChart: "Escritura de tuplas", + tuplesOutChart: "Lectura de tuplas", + blockIoChart: "E/S de bloques", }, databaseBackup: { title: "Copia de seguridad de la base de datos", diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.ts index a689350e6..712b95771 100644 --- a/apps/desktop/src/i18n/locales/it.ts +++ b/apps/desktop/src/i18n/locales/it.ts @@ -2440,6 +2440,35 @@ export default withEnglishFallback({ slowlogColumnClientName: "Nome Client", slowlogTotal: "{count} voci", slowlogDetailTitle: "Voce Slow Log #{id}", + dashboard: { + totalMemory: "Memoria totale", + usedMemory: "Memoria utilizzata", + operations: "Operazioni", + hitRatio: "Percentuale di hit", + keyCount: "Numero di chiavi", + clients: "Client", + searchIndicators: "Cerca indicatori...", + node: "Nodo", + off: "Disattivato", + refresh: "Aggiorna", + noMatchingIndicators: "Nessun indicatore corrispondente", + noDataAvailable: "Nessun dato disponibile", + sections: { + server: "Server", + clients: "Client", + memory: "Memoria", + persistence: "Persistenza", + stats: "Statistiche", + replication: "Replica", + cpu: "CPU", + modules: "Moduli", + commandstats: "Statistiche dei comandi", + errorstats: "Statistiche degli errori", + latencystats: "Statistiche della latenza", + cluster: "Cluster", + keyspace: "Spazio delle chiavi", + }, + }, }, mongo: { documents: "{count} documenti", @@ -4634,6 +4663,26 @@ export default withEnglishFallback({ commandChart: "Comandi al secondo", rawStatus: "Variabili di stato", filterStatus: "Filtra variabili di stato", + tps: "Transazioni al secondo", + activeQueries: "Query attive", + cacheHit: "Percentuale di hit della cache", + deadlocks: "Deadlock", + tempFiles: "File temporanei", + walRate: "Velocità WAL", + commit: "Commit", + rollback: "Rollback", + total: "Totale", + active: "Attive", + idle: "Inattive", + fetched: "Recuperate", + returned: "Restituite", + read: "Letture", + hits: "Hit", + serverSessionsChart: "Sessioni del server", + transactionsChart: "Transazioni al secondo", + tuplesInChart: "Scrittura delle tuple", + tuplesOutChart: "Lettura delle tuple", + blockIoChart: "I/O a blocchi", }, databaseBackup: { title: "Backup del database", diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.ts index c79924c8d..f8b784a31 100644 --- a/apps/desktop/src/i18n/locales/ja.ts +++ b/apps/desktop/src/i18n/locales/ja.ts @@ -2441,6 +2441,35 @@ export default withEnglishFallback({ slowlogColumnClientName: "クライアント名", slowlogTotal: "{count} エントリ", slowlogDetailTitle: "スローログエントリ #{id}", + dashboard: { + totalMemory: "総メモリ", + usedMemory: "使用メモリ", + operations: "操作数", + hitRatio: "ヒット率", + keyCount: "キー数", + clients: "クライアント数", + searchIndicators: "指標を検索...", + node: "ノード", + off: "オフ", + refresh: "更新", + noMatchingIndicators: "一致する指標がありません", + noDataAvailable: "データがありません", + sections: { + server: "サーバー", + clients: "クライアント", + memory: "メモリ", + persistence: "永続化", + stats: "統計", + replication: "レプリケーション", + cpu: "CPU", + modules: "モジュール", + commandstats: "コマンド統計", + errorstats: "エラー統計", + latencystats: "レイテンシ統計", + cluster: "クラスター", + keyspace: "キースペース", + }, + }, }, mongo: { documents: "{count}ドキュメント", @@ -4635,6 +4664,26 @@ export default withEnglishFallback({ commandChart: "毎秒コマンド数", rawStatus: "ステータス変数", filterStatus: "ステータス変数の絞り込み", + tps: "毎秒トランザクション数", + activeQueries: "アクティブなクエリ", + cacheHit: "キャッシュヒット率", + deadlocks: "デッドロック", + tempFiles: "一時ファイル", + walRate: "WAL 生成速度", + commit: "コミット", + rollback: "ロールバック", + total: "合計", + active: "アクティブ", + idle: "アイドル", + fetched: "フェッチ", + returned: "返却", + read: "読み取り", + hits: "ヒット", + serverSessionsChart: "サーバーセッション", + transactionsChart: "毎秒トランザクション数", + tuplesInChart: "タプル書き込み", + tuplesOutChart: "タプル読み取り", + blockIoChart: "ブロック I/O", }, databaseBackup: { title: "データベースバックアップ", diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.ts index 9150f270d..3db1c6874 100644 --- a/apps/desktop/src/i18n/locales/pt-BR.ts +++ b/apps/desktop/src/i18n/locales/pt-BR.ts @@ -2442,6 +2442,35 @@ export default withEnglishFallback({ pubsubSend: "Enviar", pubsubPublishFailed: "Publicação falhou: {error}", pubsubWsConnectFailed: "Conexão WebSocket falhou: {error}", + dashboard: { + totalMemory: "Memória total", + usedMemory: "Memória utilizada", + operations: "Operações", + hitRatio: "Taxa de acertos", + keyCount: "Quantidade de chaves", + clients: "Clientes", + searchIndicators: "Buscar indicadores...", + node: "Nó", + off: "Desativado", + refresh: "Atualizar", + noMatchingIndicators: "Nenhum indicador correspondente", + noDataAvailable: "Nenhum dado disponível", + sections: { + server: "Servidor", + clients: "Clientes", + memory: "Memória", + persistence: "Persistência", + stats: "Estatísticas", + replication: "Replicação", + cpu: "CPU", + modules: "Módulos", + commandstats: "Estatísticas de comandos", + errorstats: "Estatísticas de erros", + latencystats: "Estatísticas de latência", + cluster: "Cluster", + keyspace: "Espaço de chaves", + }, + }, }, mongo: { documents: "{count} documentos", @@ -4636,6 +4665,26 @@ export default withEnglishFallback({ commandChart: "Comandos por segundo", rawStatus: "Variáveis de estado", filterStatus: "Filtrar variáveis de estado", + tps: "Transações por segundo", + activeQueries: "Consultas ativas", + cacheHit: "Taxa de acertos do cache", + deadlocks: "Deadlocks", + tempFiles: "Arquivos temporários", + walRate: "Taxa de WAL", + commit: "Confirmações", + rollback: "Reversões", + total: "Total", + active: "Ativas", + idle: "Ociosas", + fetched: "Buscadas", + returned: "Retornadas", + read: "Leituras", + hits: "Acertos", + serverSessionsChart: "Sessões do servidor", + transactionsChart: "Transações por segundo", + tuplesInChart: "Gravação de tuplas", + tuplesOutChart: "Leitura de tuplas", + blockIoChart: "E/S de blocos", }, databaseBackup: { title: "Backup de banco de dados", diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.ts index 035af9a2e..68203a041 100644 --- a/apps/desktop/src/i18n/locales/zh-CN.ts +++ b/apps/desktop/src/i18n/locales/zh-CN.ts @@ -1925,6 +1925,26 @@ export default withEnglishFallback({ commandChart: "每秒命令数", rawStatus: "状态变量", filterStatus: "筛选状态变量", + tps: "每秒事务数", + activeQueries: "活动查询", + cacheHit: "缓存命中率", + deadlocks: "死锁", + tempFiles: "临时文件", + walRate: "WAL 生成速率", + commit: "提交", + rollback: "回滚", + total: "总计", + active: "活跃", + idle: "空闲", + fetched: "提取", + returned: "返回", + read: "读取", + hits: "命中", + serverSessionsChart: "服务器会话", + transactionsChart: "每秒事务数", + tuplesInChart: "元组写入", + tuplesOutChart: "元组读取", + blockIoChart: "块 I/O", }, userAdmin: { title: "用户与权限", @@ -2563,6 +2583,35 @@ export default withEnglishFallback({ slowlogColumnClientName: "客户端名称", slowlogTotal: "共 {count} 条", slowlogDetailTitle: "慢日志条目 #{id}", + dashboard: { + totalMemory: "总内存", + usedMemory: "已用内存", + operations: "操作数", + hitRatio: "命中率", + keyCount: "键数量", + clients: "客户端", + searchIndicators: "搜索指标...", + node: "节点", + off: "关闭", + refresh: "刷新", + noMatchingIndicators: "没有匹配的指标", + noDataAvailable: "暂无数据", + sections: { + server: "服务器", + clients: "客户端", + memory: "内存", + persistence: "持久化", + stats: "统计", + replication: "复制", + cpu: "CPU", + modules: "模块", + commandstats: "命令统计", + errorstats: "错误统计", + latencystats: "延迟统计", + cluster: "集群", + keyspace: "键空间", + }, + }, }, mongo: { documents: "{count} 个文档", diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.ts index 31799e79b..7a393ed84 100644 --- a/apps/desktop/src/i18n/locales/zh-TW.ts +++ b/apps/desktop/src/i18n/locales/zh-TW.ts @@ -2259,6 +2259,35 @@ export default withEnglishFallback({ pubsubSend: "傳送", pubsubPublishFailed: "發布失敗: {error}", pubsubWsConnectFailed: "WebSocket 連線失敗: {error}", + dashboard: { + totalMemory: "總記憶體", + usedMemory: "已用記憶體", + operations: "操作數", + hitRatio: "命中率", + keyCount: "鍵數量", + clients: "客戶端", + searchIndicators: "搜尋指標...", + node: "節點", + off: "關閉", + refresh: "重新整理", + noMatchingIndicators: "沒有符合的指標", + noDataAvailable: "暫無資料", + sections: { + server: "伺服器", + clients: "客戶端", + memory: "記憶體", + persistence: "持久化", + stats: "統計", + replication: "複寫", + cpu: "CPU", + modules: "模組", + commandstats: "命令統計", + errorstats: "錯誤統計", + latencystats: "延遲統計", + cluster: "叢集", + keyspace: "鍵空間", + }, + }, }, mongo: { documents: "{count} 個文件", @@ -4636,6 +4665,26 @@ export default withEnglishFallback({ commandChart: "每秒命令數", rawStatus: "狀態變數", filterStatus: "篩選狀態變數", + tps: "每秒事務數", + activeQueries: "作用中查詢", + cacheHit: "快取命中率", + deadlocks: "死鎖", + tempFiles: "暫存檔案", + walRate: "WAL 產生速率", + commit: "提交", + rollback: "回溯", + total: "總計", + active: "作用中", + idle: "閒置", + fetched: "擷取", + returned: "傳回", + read: "讀取", + hits: "命中", + serverSessionsChart: "伺服器工作階段", + transactionsChart: "每秒事務數", + tuplesInChart: "元組寫入", + tuplesOutChart: "元組讀取", + blockIoChart: "區塊 I/O", }, databaseBackup: { title: "資料庫備份",