feat: implement debug logging cleanup and i18n coverage proposals

## cleanup-debug-logging
- Create environment-aware logger utility (logger.ts)
- Replace 60+ console.log/error statements across 28 files
- Production: only warn/error logs visible
- Development: all log levels with prefixes

Updated files:
- Contexts: NotificationContext, ProjectSyncContext, AuthContext
- Components: GanttChart, CalendarView, ErrorBoundary, and 11 others
- Pages: Tasks, Projects, Dashboard, and 7 others
- Services: api.ts

## complete-i18n-coverage
- WeeklyReportPreview: all strings translated, dynamic locale
- ReportHistory: all strings translated, dynamic locale
- AuditPage: detail modal and verification modal translated
- WorkloadPage: error message translated

Locale files updated:
- en/common.json, zh-TW/common.json: reports section
- en/audit.json, zh-TW/audit.json: modal sections
- en/workload.json, zh-TW/workload.json: errors section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beabigegg
2026-01-13 21:37:29 +08:00
parent ed8d30e9bd
commit 4b7e523f84
37 changed files with 430 additions and 207 deletions

View File

@@ -52,5 +52,39 @@
"empty": {
"title": "沒有稽核記錄",
"description": "目前沒有符合條件的稽核記錄"
},
"modal": {
"details": {
"title": "稽核日誌詳情",
"eventType": "事件類型:",
"action": "操作:",
"resource": "資源:",
"user": "使用者:",
"ipAddress": "IP 位址:",
"sensitivity": "敏感度:",
"time": "時間:",
"changes": "變更內容",
"field": "欄位",
"oldValue": "舊值",
"newValue": "新值",
"checksum": "校驗碼:",
"na": "無",
"system": "系統"
},
"verification": {
"title": "完整性驗證",
"verifying": "正在驗證稽核日誌完整性...",
"verifyingHint": "根據記錄數量,這可能需要一些時間。",
"failed": "驗證失敗",
"statusSuccess": "完整性已驗證",
"statusFailed": "偵測到完整性問題",
"successDescription": "所有稽核記錄都具有有效的校驗碼,未被竄改。",
"failedDescription": "部分稽核記錄的校驗碼無效,表示可能存在竄改或損壞。",
"totalChecked": "已檢查總數",
"valid": "有效",
"invalid": "無效",
"invalidRecords": "無效記錄",
"invalidRecordsDescription": "以下記錄 ID 未通過完整性驗證:"
}
}
}

View File

@@ -21,7 +21,8 @@
"remove": "移除",
"view": "檢視",
"download": "下載",
"upload": "上傳"
"upload": "上傳",
"retry": "重試"
},
"labels": {
"loading": "載入中...",
@@ -135,5 +136,60 @@
"maxFileSize": "檔案大小上限:{{size}}",
"uploading": "正在上傳 {{filename}} ({{current}}/{{total}})...",
"uploadFailed": "上傳失敗"
},
"reports": {
"weeklyPreview": {
"title": "週報預覽",
"generateNow": "立即產生",
"generating": "產生中...",
"loading": "載入報告預覽中...",
"noData": "無可用的報告資料",
"noProjects": "找不到專案",
"projects": "專案",
"retry": "重試",
"completedShort": "已完成",
"done": "完成",
"inProgressLower": "進行中",
"overdueLower": "逾期",
"blockedLower": "受阻",
"nextWeekLower": "下週",
"unassigned": "未指派",
"due": "截止",
"since": "自",
"noReasonProvided": "未提供原因",
"daysOverdue": "逾期 {{count}} 天",
"status": {
"completed": "已完成",
"inProgress": "進行中",
"overdue": "逾期",
"blocked": "受阻",
"nextWeek": "下週",
"total": "總計"
},
"errors": {
"loadFailed": "載入報告預覽失敗",
"generateFailed": "產生報告失敗"
},
"messages": {
"generateSuccess": "報告已產生並發送通知!"
}
},
"history": {
"title": "報告歷史",
"loading": "載入歷史中...",
"retry": "重試",
"empty": "找不到報告歷史記錄。報告會在每週五 16:00 自動產生。",
"totalReports": "{{count}} 份報告",
"completed": "已完成",
"inProgress": "進行中",
"overdue": "逾期",
"status": {
"sent": "已發送",
"failed": "失敗"
},
"errors": {
"loadFailed": "載入報告歷史失敗"
}
}
}
}

View File

@@ -68,5 +68,8 @@
"normal": "正常:< 80%",
"warning": "警告80% - 99%",
"overloaded": "超載:≥ 100%"
},
"errors": {
"loadFailed": "載入工作負載資料失敗,請再試一次。"
}
}