From 9dcaecd2d27e6325bae0c53b9ab41eb86d0269cd Mon Sep 17 00:00:00 2001 From: Dominik Seemann Date: Thu, 7 May 2026 17:42:05 +0000 Subject: [PATCH] docs(i18n): translate chinese comments in frontend src to english Translate chinese developer comments in frontend/src/ to english so non-chinese-reading maintainers can understand intent without translation tooling. Pure documentation cleanup with no runtime behavior changes. Twenty files updated across views, components, api services, App.vue, and pendingUpload.js. Region-eligibility matrix from .kiro/specs/i18n- frontend-comments/design.md drives every edit: - Translate `//`, `/* */`, JSDoc, and Vue `` template comments. - Drop comments that merely restate the code per dev-guidelines.md. - Translate console.error/warn/log argument strings (developer-facing). - Append (#9) to the single chinese-content TODO in views/Process.vue. Five files retain documented chinese string literals per requirements 1.5 and 4.4: hardcoded UI text and error fallbacks (Process.vue, Step3Simulation.vue), backend-format regex patterns and i18n-keyed UI labels (Step4Report.vue), backend stage-key matchers (Step2EnvSetup.vue), and LLM prompt templates sent to a chinese-tuned model (Step5Interaction.vue). Translating any of these would either be out of scope (UI strings belong in /locales/*.json) or would change runtime behavior. Verification: `rg '[\x{4e00}-\x{9fff}]' frontend/src/` returns 5 documented files; `npm run build` exits 0 with the same Vite output as before. Closes #9 --- .kiro/specs/i18n-frontend-comments/design.md | 229 +++++++++++++ .../i18n-frontend-comments/gap-analysis.md | 133 ++++++++ .../i18n-frontend-comments/requirements.md | 70 ++++ .../specs/i18n-frontend-comments/research.md | 97 ++++++ .kiro/specs/i18n-frontend-comments/spec.json | 23 ++ .kiro/specs/i18n-frontend-comments/tasks.md | 53 +++ frontend/src/App.vue | 7 +- frontend/src/api/graph.js | 20 +- frontend/src/api/index.js | 19 +- frontend/src/api/report.js | 16 +- frontend/src/api/simulation.js | 58 ++-- frontend/src/components/GraphPanel.vue | 192 ++++++----- frontend/src/components/HistoryDatabase.vue | 272 +++++++--------- frontend/src/components/Step1GraphBuild.vue | 15 +- frontend/src/components/Step2EnvSetup.vue | 156 ++++----- frontend/src/components/Step3Simulation.vue | 116 +++---- frontend/src/components/Step4Report.vue | 303 +++++++++--------- frontend/src/components/Step5Interaction.vue | 80 +++-- frontend/src/store/pendingUpload.js | 5 +- frontend/src/views/Home.vue | 82 ++--- frontend/src/views/InteractionView.vue | 9 +- frontend/src/views/MainView.vue | 10 +- frontend/src/views/Process.vue | 260 +++++++-------- frontend/src/views/ReportView.vue | 9 +- frontend/src/views/SimulationRunView.vue | 51 ++- frontend/src/views/SimulationView.vue | 58 ++-- 26 files changed, 1394 insertions(+), 949 deletions(-) create mode 100644 .kiro/specs/i18n-frontend-comments/design.md create mode 100644 .kiro/specs/i18n-frontend-comments/gap-analysis.md create mode 100644 .kiro/specs/i18n-frontend-comments/requirements.md create mode 100644 .kiro/specs/i18n-frontend-comments/research.md create mode 100644 .kiro/specs/i18n-frontend-comments/spec.json create mode 100644 .kiro/specs/i18n-frontend-comments/tasks.md diff --git a/.kiro/specs/i18n-frontend-comments/design.md b/.kiro/specs/i18n-frontend-comments/design.md new file mode 100644 index 00000000..5d863448 --- /dev/null +++ b/.kiro/specs/i18n-frontend-comments/design.md @@ -0,0 +1,229 @@ +# Design Document — i18n-frontend-comments + +## Overview + +**Purpose**: Translate Chinese developer comments in `frontend/src/` to English so non-Chinese-reading maintainers can understand intent without translation tooling. Strictly documentation-only; no behavior change. + +**Users**: Frontend maintainers and reviewers of MiroFish — developers who read and modify `frontend/src/` but do not read Chinese. + +**Impact**: 20 files in `frontend/src/` change; the compiled bundle is byte-equivalent modulo source-map comment lines. The `vue-i18n` user-facing translation surface (`/locales/*.json`) is unaffected. + +### Goals + +- Eliminate Chinese characters (U+4E00–U+9FFF) from `frontend/src/` comments and dev-facing string literals (`console.*`). +- Preserve every comment's *why* (semantic intent) when translating; delete comments that merely restate the code per `dev-guidelines.md`. +- Append `(#9)` ticket reference to any TODO/FIXME marker that lacks one. +- Keep `npm run build` green and the rendered UI byte-equivalent on a smoke check. + +### Non-Goals + +- Translating user-facing strings (those live in `/locales/*.json`; tracked separately). +- Translating LLM prompt template strings (translation would change model input — retained and documented in PR per Requirement 1.5). +- Restructuring comments into JSDoc (only keep JSDoc when already JSDoc-shaped). +- Reformatting code, renaming identifiers, or any change to `