From 2629fcce232483f7ce511fcb2176a292980bcb9b Mon Sep 17 00:00:00 2001 From: Will Miao Date: Mon, 25 May 2026 22:35:48 +0800 Subject: [PATCH] fix(doctor): add i18n translations for check items, action buttons, and labels Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- locales/de.json | 25 ++++++++++++++++++++++++- locales/en.json | 25 ++++++++++++++++++++++++- locales/es.json | 25 ++++++++++++++++++++++++- locales/fr.json | 25 ++++++++++++++++++++++++- locales/he.json | 25 ++++++++++++++++++++++++- locales/ja.json | 25 ++++++++++++++++++++++++- locales/ko.json | 25 ++++++++++++++++++++++++- locales/ru.json | 25 ++++++++++++++++++++++++- locales/zh-CN.json | 25 ++++++++++++++++++++++++- locales/zh-TW.json | 25 ++++++++++++++++++++++++- static/js/managers/DoctorManager.js | 22 ++++++++++++++++------ 11 files changed, 256 insertions(+), 16 deletions(-) diff --git a/locales/de.json b/locales/de.json index 59424136..5f901b10 100644 --- a/locales/de.json +++ b/locales/de.json @@ -1927,9 +1927,32 @@ "warning": "Handlungsbedarf", "error": "Aktion erforderlich" }, + "issues": { + "civitai_api_key": { + "title": "Civitai API Key" + }, + "cache_health": { + "title": "Model Cache Health" + }, + "filename_conflicts": { + "title": "Duplicate Filename Conflicts" + }, + "ui_version": { + "title": "UI Version" + } + }, "actions": { "runAgain": "Erneut ausführen", - "exportBundle": "Paket exportieren" + "exportBundle": "Paket exportieren", + "open-settings": "Open Settings", + "open-settings-syntax-format": "Switch to Full Path Syntax", + "repair-cache": "Rebuild Cache", + "resolve-filename-conflicts": "Resolve Conflicts", + "reload-page": "Reload UI" + }, + "labels": { + "conflicts": "Conflicts", + "version": "Version" }, "toast": { "loadFailed": "Diagnose konnte nicht geladen werden: {message}", diff --git a/locales/en.json b/locales/en.json index bcc188dd..e1d837aa 100644 --- a/locales/en.json +++ b/locales/en.json @@ -1927,9 +1927,32 @@ "warning": "Needs Attention", "error": "Action Required" }, + "issues": { + "civitai_api_key": { + "title": "Civitai API Key" + }, + "cache_health": { + "title": "Model Cache Health" + }, + "filename_conflicts": { + "title": "Duplicate Filename Conflicts" + }, + "ui_version": { + "title": "UI Version" + } + }, "actions": { "runAgain": "Run Again", - "exportBundle": "Export Bundle" + "exportBundle": "Export Bundle", + "open-settings": "Open Settings", + "open-settings-syntax-format": "Switch to Full Path Syntax", + "repair-cache": "Rebuild Cache", + "resolve-filename-conflicts": "Resolve Conflicts", + "reload-page": "Reload UI" + }, + "labels": { + "conflicts": "Conflicts", + "version": "Version" }, "toast": { "loadFailed": "Failed to load diagnostics: {message}", diff --git a/locales/es.json b/locales/es.json index dba55f04..7007a3c8 100644 --- a/locales/es.json +++ b/locales/es.json @@ -1927,9 +1927,32 @@ "warning": "Requiere atención", "error": "Se requiere acción" }, + "issues": { + "civitai_api_key": { + "title": "Civitai API Key" + }, + "cache_health": { + "title": "Model Cache Health" + }, + "filename_conflicts": { + "title": "Duplicate Filename Conflicts" + }, + "ui_version": { + "title": "UI Version" + } + }, "actions": { "runAgain": "Ejecutar de nuevo", - "exportBundle": "Exportar paquete" + "exportBundle": "Exportar paquete", + "open-settings": "Open Settings", + "open-settings-syntax-format": "Switch to Full Path Syntax", + "repair-cache": "Rebuild Cache", + "resolve-filename-conflicts": "Resolve Conflicts", + "reload-page": "Reload UI" + }, + "labels": { + "conflicts": "Conflicts", + "version": "Version" }, "toast": { "loadFailed": "Error al cargar los diagnósticos: {message}", diff --git a/locales/fr.json b/locales/fr.json index 4fc07c0c..a9bfe5f8 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -1927,9 +1927,32 @@ "warning": "Nécessite une attention", "error": "Action requise" }, + "issues": { + "civitai_api_key": { + "title": "Civitai API Key" + }, + "cache_health": { + "title": "Model Cache Health" + }, + "filename_conflicts": { + "title": "Duplicate Filename Conflicts" + }, + "ui_version": { + "title": "UI Version" + } + }, "actions": { "runAgain": "Relancer", - "exportBundle": "Exporter le lot" + "exportBundle": "Exporter le lot", + "open-settings": "Open Settings", + "open-settings-syntax-format": "Switch to Full Path Syntax", + "repair-cache": "Rebuild Cache", + "resolve-filename-conflicts": "Resolve Conflicts", + "reload-page": "Reload UI" + }, + "labels": { + "conflicts": "Conflicts", + "version": "Version" }, "toast": { "loadFailed": "Échec du chargement des diagnostics : {message}", diff --git a/locales/he.json b/locales/he.json index dac9de7e..6d187495 100644 --- a/locales/he.json +++ b/locales/he.json @@ -1927,9 +1927,32 @@ "warning": "דורש תשומת לב", "error": "נדרשת פעולה" }, + "issues": { + "civitai_api_key": { + "title": "Civitai API Key" + }, + "cache_health": { + "title": "Model Cache Health" + }, + "filename_conflicts": { + "title": "Duplicate Filename Conflicts" + }, + "ui_version": { + "title": "UI Version" + } + }, "actions": { "runAgain": "הפעל שוב", - "exportBundle": "ייצוא חבילה" + "exportBundle": "ייצוא חבילה", + "open-settings": "Open Settings", + "open-settings-syntax-format": "Switch to Full Path Syntax", + "repair-cache": "Rebuild Cache", + "resolve-filename-conflicts": "Resolve Conflicts", + "reload-page": "Reload UI" + }, + "labels": { + "conflicts": "Conflicts", + "version": "Version" }, "toast": { "loadFailed": "טעינת האבחון נכשלה: {message}", diff --git a/locales/ja.json b/locales/ja.json index 407e848c..ef422633 100644 --- a/locales/ja.json +++ b/locales/ja.json @@ -1927,9 +1927,32 @@ "warning": "要注意", "error": "対応が必要" }, + "issues": { + "civitai_api_key": { + "title": "Civitai API キー" + }, + "cache_health": { + "title": "モデルキャッシュの健全性" + }, + "filename_conflicts": { + "title": "ファイル名重複競合" + }, + "ui_version": { + "title": "UI バージョン" + } + }, "actions": { "runAgain": "再実行", - "exportBundle": "パッケージをエクスポート" + "exportBundle": "パッケージをエクスポート", + "open-settings": "設定を開く", + "open-settings-syntax-format": "フルパス構文に切り替え", + "repair-cache": "キャッシュを再構築", + "resolve-filename-conflicts": "競合を解決", + "reload-page": "UI をリロード" + }, + "labels": { + "conflicts": "競合", + "version": "バージョン" }, "toast": { "loadFailed": "診断の読み込みに失敗しました: {message}", diff --git a/locales/ko.json b/locales/ko.json index 4bbfa3e5..2cfeab8e 100644 --- a/locales/ko.json +++ b/locales/ko.json @@ -1927,9 +1927,32 @@ "warning": "주의 필요", "error": "조치 필요" }, + "issues": { + "civitai_api_key": { + "title": "Civitai API 키" + }, + "cache_health": { + "title": "모델 캐시 상태" + }, + "filename_conflicts": { + "title": "파일명 중복 충돌" + }, + "ui_version": { + "title": "UI 버전" + } + }, "actions": { "runAgain": "다시 실행", - "exportBundle": "번들 내보내기" + "exportBundle": "번들 내보내기", + "open-settings": "설정 열기", + "open-settings-syntax-format": "전체 경로 구문으로 전환", + "repair-cache": "캐시 재구축", + "resolve-filename-conflicts": "충돌 해결", + "reload-page": "UI 새로고침" + }, + "labels": { + "conflicts": "충돌", + "version": "버전" }, "toast": { "loadFailed": "진단 로드 실패: {message}", diff --git a/locales/ru.json b/locales/ru.json index 64e2d478..40821803 100644 --- a/locales/ru.json +++ b/locales/ru.json @@ -1927,9 +1927,32 @@ "warning": "Требует внимания", "error": "Требуется действие" }, + "issues": { + "civitai_api_key": { + "title": "Civitai API Key" + }, + "cache_health": { + "title": "Model Cache Health" + }, + "filename_conflicts": { + "title": "Duplicate Filename Conflicts" + }, + "ui_version": { + "title": "UI Version" + } + }, "actions": { "runAgain": "Запустить снова", - "exportBundle": "Экспортировать пакет" + "exportBundle": "Экспортировать пакет", + "open-settings": "Open Settings", + "open-settings-syntax-format": "Switch to Full Path Syntax", + "repair-cache": "Rebuild Cache", + "resolve-filename-conflicts": "Resolve Conflicts", + "reload-page": "Reload UI" + }, + "labels": { + "conflicts": "Conflicts", + "version": "Version" }, "toast": { "loadFailed": "Не удалось загрузить диагностику: {message}", diff --git a/locales/zh-CN.json b/locales/zh-CN.json index bfd7568c..9003e42e 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -1927,9 +1927,32 @@ "warning": "需要关注", "error": "需要处理" }, + "issues": { + "civitai_api_key": { + "title": "Civitai API 密钥" + }, + "cache_health": { + "title": "模型缓存健康状态" + }, + "filename_conflicts": { + "title": "文件名重复冲突" + }, + "ui_version": { + "title": "UI 版本" + } + }, "actions": { "runAgain": "重新检查", - "exportBundle": "导出诊断包" + "exportBundle": "导出诊断包", + "open-settings": "打开设置", + "open-settings-syntax-format": "切换为完整路径语法", + "repair-cache": "重建缓存", + "resolve-filename-conflicts": "解决冲突", + "reload-page": "刷新 UI" + }, + "labels": { + "conflicts": "冲突详情", + "version": "版本信息" }, "toast": { "loadFailed": "加载诊断结果失败:{message}", diff --git a/locales/zh-TW.json b/locales/zh-TW.json index 5f807d1a..30c9cff2 100644 --- a/locales/zh-TW.json +++ b/locales/zh-TW.json @@ -1927,9 +1927,32 @@ "warning": "需要注意", "error": "需要處理" }, + "issues": { + "civitai_api_key": { + "title": "Civitai API 金鑰" + }, + "cache_health": { + "title": "模型快取健康狀態" + }, + "filename_conflicts": { + "title": "檔案名稱重複衝突" + }, + "ui_version": { + "title": "UI 版本" + } + }, "actions": { "runAgain": "重新執行", - "exportBundle": "匯出套件" + "exportBundle": "匯出套件", + "open-settings": "開啟設定", + "open-settings-syntax-format": "切換為完整路徑語法", + "repair-cache": "重建快取", + "resolve-filename-conflicts": "解決衝突", + "reload-page": "重新載入 UI" + }, + "labels": { + "conflicts": "衝突詳情", + "version": "版本" }, "toast": { "loadFailed": "載入診斷失敗:{message}", diff --git a/static/js/managers/DoctorManager.js b/static/js/managers/DoctorManager.js index fbb365c9..4e9407e2 100644 --- a/static/js/managers/DoctorManager.js +++ b/static/js/managers/DoctorManager.js @@ -225,6 +225,13 @@ export class DoctorManager { renderIssueCard(item) { const status = item.status || 'ok'; const tagLabel = this.getStatusLabel(status); + + const titleKey = `doctor.issues.${item.id || ''}.title`; + const displayTitle = translate(titleKey, {}, item.title || ''); + + const summaryKey = `doctor.issues.${item.id || ''}.summary.${status}`; + const displaySummary = translate(summaryKey, {}, item.summary || ''); + const details = Array.isArray(item.details) ? item.details : []; const listItems = details .filter((detail) => typeof detail === 'string') @@ -235,19 +242,22 @@ export class DoctorManager { .map((detail) => this.renderInlineDetail(detail)) .join(''); const actions = (item.actions || []) - .map((action) => ` + .map((action) => { + const actionLabel = translate(`doctor.actions.${action.id}`, {}, action.label); + return ` - `) + `; + }) .join(''); return `
-

${escapeHtml(item.title || '')}

-

${escapeHtml(item.summary || '')}

+

${escapeHtml(displayTitle)}

+

${escapeHtml(displaySummary)}

${escapeHtml(tagLabel)}
@@ -262,7 +272,7 @@ export class DoctorManager { if (detail.conflict_groups || detail.total_conflict_files) { return `
- ${escapeHtml(translate('doctor.status.warning', {}, 'Conflicts'))} + ${escapeHtml(translate('doctor.labels.conflicts', {}, 'Conflicts'))}
${escapeHtml(`${detail.conflict_groups || 0} filenames, ${detail.total_conflict_files || 0} files`)}
`;