feat(i18n): make web and CLI language-aware#1748
Conversation
|
Someone is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
Add shared CLI translation resources and web i18next/react-i18next wiring so GitNexus can present core command and UI text in English or Chinese while preserving existing defaults. Constraint: PR abhigyanpatwari#1748 was previously stacked on obsolete abhigyanpatwari#1747 work, so this branch is rebuilt from upstream/main and contains only i18n changes.\nRejected: Keeping the old stacked branch | it carried obsolete lbug sidecar commits and stayed conflicting after abhigyanpatwari#1747 merged.\nConfidence: medium\nScope-risk: broad\nDirective: Keep future i18n follow-ups separated from native-worker and lbug recovery fixes; update both locale trees together when adding translatable UI text.\nTested: GitNexus impact analysis for App, Header, useAppState, cleanCommand, doctorCommand; GitNexus detect_changes on staged linked worktree; CLI i18n vitest targets; web i18n vitest targets; gitnexus npx tsc --noEmit; gitnexus-web npx tsc -b --noEmit; gitnexus-web npm test; gitnexus-web npm run build; gitnexus npm run build.\nNot-tested: Browser visual/manual language switching; production Vercel deployment; full gitnexus npm test ended with Vitest unhandled simulated worker-pool startup crash after all 355 files and 9180 assertions passed.
ece02ae to
2f0eebc
Compare
Add shared CLI translation resources and web i18next/react-i18next wiring so GitNexus can present core command and UI text in English or Chinese while preserving existing defaults. Keep the heartbeat reconnect banner on a dedicated translation key so disconnect recovery remains distinguishable from initial server connection failures. Constraint: PR abhigyanpatwari#1748 was previously stacked on obsolete abhigyanpatwari#1747 work, so this branch is rebuilt from upstream/main and contains only i18n changes. Rejected: Keeping the old stacked branch | it carried obsolete lbug sidecar commits and stayed conflicting after abhigyanpatwari#1747 merged. Confidence: medium Scope-risk: broad Directive: Keep future i18n follow-ups separated from native-worker and lbug recovery fixes; update both locale trees together when adding translatable UI text. Tested: GitNexus impact analysis for App, Header, useAppState, cleanCommand, doctorCommand, and AppContent; GitNexus detect_changes on the linked worktree; CLI i18n vitest targets; web i18n vitest targets; gitnexus npx tsc --noEmit; gitnexus-web npx tsc -b --noEmit; gitnexus-web npm test; gitnexus-web npm run build; gitnexus npm run build; local Playwright heartbeat-reconnect e2e spec. Not-tested: Full browser visual/manual language switching; production Vercel deployment; full gitnexus npm test ended with Vitest unhandled simulated worker-pool startup crash after all 355 files and 9180 assertions passed.
2f0eebc to
ea5a012
Compare
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 9583 tests passed 1 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
Add shared CLI translation resources and web i18next/react-i18next wiring so GitNexus can present core command and UI text in English or Chinese while preserving existing defaults. Keep the heartbeat reconnect banner on a dedicated translation key so disconnect recovery remains distinguishable from initial server connection failures. Constraint: PR abhigyanpatwari#1748 was previously stacked on obsolete abhigyanpatwari#1747 work, so this branch is rebuilt from upstream/main and contains only i18n changes. Rejected: Keeping the old stacked branch | it carried obsolete lbug sidecar commits and stayed conflicting after abhigyanpatwari#1747 merged. Confidence: medium Scope-risk: broad Directive: Keep future i18n follow-ups separated from native-worker and lbug recovery fixes; update both locale trees together when adding translatable UI text. Tested: GitNexus impact analysis for App, Header, useAppState, cleanCommand, doctorCommand, and AppContent; GitNexus detect_changes on the linked worktree; CLI i18n vitest targets; web i18n vitest targets; gitnexus npx tsc --noEmit; gitnexus-web npx tsc -b --noEmit; gitnexus-web npm test; gitnexus-web npm run build; gitnexus npm run build; local Playwright heartbeat-reconnect e2e spec. Not-tested: Full browser visual/manual language switching; production Vercel deployment; full gitnexus npm test ended with Vitest unhandled simulated worker-pool startup crash after all 355 files and 9180 assertions passed.
ea5a012 to
044a48f
Compare
Add shared CLI translation resources and web i18next/react-i18next wiring so GitNexus can present core command and UI text in English or Chinese while preserving existing defaults. Keep the heartbeat reconnect banner on a dedicated translation key so disconnect recovery remains distinguishable from initial server connection failures. Constraint: PR abhigyanpatwari#1748 was previously stacked on obsolete abhigyanpatwari#1747 work, so this branch is rebuilt from upstream/main and contains only i18n changes. Rejected: Keeping the old stacked branch | it carried obsolete lbug sidecar commits and stayed conflicting after abhigyanpatwari#1747 merged. Confidence: medium Scope-risk: broad Directive: Keep future i18n follow-ups separated from native-worker and lbug recovery fixes; update both locale trees together when adding translatable UI text. Tested: GitNexus impact analysis for App, Header, useAppState, cleanCommand, doctorCommand, and AppContent; GitNexus detect_changes on the linked worktree; CLI i18n vitest targets; web i18n vitest targets; gitnexus npx tsc --noEmit; gitnexus-web npx tsc -b --noEmit; gitnexus-web npm test; gitnexus-web npm run build; gitnexus npm run build; local Playwright heartbeat-reconnect e2e spec. Not-tested: Full browser visual/manual language switching; production Vercel deployment; full gitnexus npm test ended with Vitest unhandled simulated worker-pool startup crash after all 355 files and 9180 assertions passed.
044a48f to
eea4b2a
Compare
|
Claude finished @magyargergo's task in 7m 54s —— View job PR #1748 Production-Readiness ReviewTasks completed:
Review bar for this PRApplied: Problem being solvedGitNexus serves both a Vite/React web UI and a Node CLI. This PR adds i18n to both surfaces: English (default) and Simplified Chinese, with browser-language detection, localStorage persistence, a Current PR state
Merge status and mergeabilityNot mergeable yet. Main CI workflow ( Repository history considered
Branch hygiene assessmentClean. Single i18n-scoped commit, no unrelated churn, no merge-from-main commits, no workflow/Docker changes, no shared-contract drift ( Understanding of the changeThe PR implements a two-layer i18n system: Web (i18next + react-i18next): Eager-loaded JSON locale modules via CLI (custom FindingsFinding 1 —
|
|
@ChamHerry Can you please look into these findings? Also could you please answer the open questions? |
Merge the latest upstream main into the i18n branch while resolving the web package lockfile against the merged dependency set. Preserve the existing merge-based PR history instead of rewriting the branch. Constraint: PR branch already contained merge-from-main commits, so merge avoids force-push/rebase risk. Rejected: Rebasing the PR branch | would rewrite published branch history and complicate review continuity. Confidence: medium Scope-risk: broad Directive: Re-run full CI after pushing because upstream main brought ingestion/lbug/analyze changes beyond the lockfile conflict resolution. Tested: gitnexus-web npm install --package-lock-only --ignore-scripts; git diff --check; gitnexus-web npm test -- test/unit/i18n.test.tsx; gitnexus-web npx tsc -b --noEmit; gitnexus npx vitest run test/unit/cli-i18n.test.ts test/unit/cli-message.test.ts; gitnexus npx tsc --noEmit; GitNexus detect_changes on staged merge. Not-tested: full npm test suites; Playwright e2e; post-push GitHub CI.
Keep the fix scoped to review findings: terminal-width-safe doctor output, canonical language normalization, CLI plural selection, stable auto-connect translation usage, and browser coverage for header language switching. Constraint: PR abhigyanpatwari#1748 review requested i18n correctness fixes without broad architecture changes. Rejected: Adding a width/persistence dependency | Local helpers and existing i18next detector hooks cover the reviewed cases with less dependency churn. Confidence: high Scope-risk: moderate Directive: Keep Traditional Chinese unsupported until a zh-TW resource is added; do not map zh-Hant locales to zh-CN. Tested: cd gitnexus && npx vitest run test/unit/cli-i18n.test.ts test/unit/cli-message.test.ts test/unit/doctor-format.test.ts Tested: cd gitnexus-web && npm test -- i18n.test.tsx Tested: cd gitnexus && npx tsc --noEmit Tested: cd gitnexus-web && npx tsc -b --noEmit Tested: npx eslint <changed files> Tested: git diff --check Tested: cd gitnexus-web && npm run test:e2e -- language-switching.spec.ts Tested: cd gitnexus-web && npm test Tested: mcp__gitnexus__.detect_changes(scope="staged", repo="GitNexus") Not-tested: cd gitnexus && npm test currently fails 5 pre-existing/local-env owner-guard cases in test/unit/hooks.test.ts unrelated to the i18n changes.
|
@magyargergo I pushed commit Addressed:
Open questions:
Local validation:
Note: |
Route Commander help headings, root command descriptions, subcommand descriptions, option descriptions, defaults labels, and analyze custom help text through the existing CLI i18n resources so `GITNEXUS_LANG=zh-CN gitnexus -h` no longer shows English-only copy. Constraint: PR abhigyanpatwari#1748 review fixes must keep machine-facing tool output stable; this only changes human-facing Commander help text. Rejected: Rewriting every command registration inline | A post-registration help localization pass keeps lazy command setup stable and avoids broad command action churn. Confidence: high Scope-risk: narrow Directive: Keep CLI syntax tokens and env var names untranslated; localize explanatory prose only. Tested: cd gitnexus && npx vitest run test/unit/cli-index-help.test.ts test/unit/cli-i18n.test.ts test/unit/cli-message.test.ts test/unit/doctor-format.test.ts Tested: cd gitnexus && npx tsc --noEmit Tested: cd gitnexus && npx eslint src/cli/index.ts src/cli/help-i18n.ts src/cli/i18n/en.ts src/cli/i18n/zh-CN.ts test/unit/cli-index-help.test.ts Tested: cd gitnexus && git diff --check Tested: GITNEXUS_LANG=zh-CN node --import tsx src/cli/index.ts --help Tested: GITNEXUS_LANG=zh-CN node --import tsx src/cli/index.ts query --help Tested: GITNEXUS_LANG=zh-CN node --import tsx src/cli/index.ts analyze --help Tested: mcp__gitnexus__.detect_changes(scope="staged", repo="GitNexus") Not-tested: cd gitnexus && npm test not rerun; earlier full suite still had 5 pre-existing/local-env owner-guard failures in test/unit/hooks.test.ts unrelated to CLI i18n help.
|
@magyargergo Follow-up pushed in What changed:
Validation:
The PR head is now |
|
Claude finished @magyargergo's task in 12m 1s —— View job PR #1748 Production-Readiness Review — Second PassTasks completed
Review bar for this PRApplied: Problem being solvedGitNexus exposes both a Vite/React web UI and a Node CLI. This PR makes both surfaces language-aware: English (default) and Simplified Chinese, with browser-language detection, localStorage persistence, a Current PR state
Merge status and mergeabilityNot mergeable yet. The main CI workflow is Repository history considered
Branch hygiene assessmentMerge-from-main commits present; final diff is i18n-scoped. The commit history contains Classification: merge-from-main history present but PR diff is clean. Rebase not required. Understanding of the changeWeb i18next/react-i18next layer: CLI i18n layer: Custom Automation safety: FindingsFinding 1 — Prior blocker: CJK
|
Localize Commander metadata and detect-changes result labels while sharing the formatter across CLI and eval-server paths. Reset the persisted web language key in Vitest setup so language state cannot leak across tests. Constraint: PR abhigyanpatwari#1748 second-pass review identified three non-blocking i18n gaps to close without changing machine-readable MCP/tool JSON contracts. Rejected: Leaving eval-server with a duplicated detect-changes formatter | would preserve future English-only drift. Confidence: high Scope-risk: narrow Directive: Keep protocol/JSON paths separate from human-readable CLI localization changes. Tested: cd gitnexus && npx vitest run test/unit/cli-index-help.test.ts test/unit/cli-i18n.test.ts test/unit/tool-direct-cli.test.ts test/unit/eval-formatters.test.ts test/unit/cli-message.test.ts test/unit/doctor-format.test.ts; cd gitnexus && npx tsc --noEmit; cd gitnexus-web && npx vitest run test/unit/i18n.test.tsx test/unit/embedding-auto-start.test.ts test/unit/settings-service.test.ts test/unit/test-setup-storage.test.ts; cd gitnexus-web && npx tsc -b --noEmit; npm test in gitnexus-web; gitnexus detect_changes --scope staged. Not-tested: cd gitnexus && npm test full combined run remained flaky in hooks.test.ts; reran test/unit/hooks.test.ts alone and it passed.
|
@magyargergo Fixed the three second-pass follow-ups and pushed commit What changed:
Call-chain / implementation plan artifact:
Validation:
Note: a full combined |
| @@ -0,0 +1,204 @@ | |||
| # PR #1748 第二轮审查 Follow-up 修复方案与调用链分析 | |||
There was a problem hiding this comment.
can you please remove this doc file?
问题描述(What): 将 docs/ 文件夹从 git 版本控制中移除并加入 .gitignore 根本原因(Why): docs/ 为本地文档目录,不应纳入 PR diff 和版本控制 修复内容(How): git rm --cached -r docs/ + 更新 .gitignore 排除整个 docs/ 目录 技术细节(Details): 13 个文件从跟踪中移除,磁盘文件保留不变 影响范围(Impact): PR abhigyanpatwari#1748 diff 将不再包含 docs/ 文件
|
@magyargergo Done! Removed the entire |
|
Claude finished @magyargergo's task in 7m 23s —— View job PR #1748 Production-Readiness Review — Last Round (Translation Coverage Focus)Tasks completed:
Review bar for this PRApplied: Problem being solvedGitNexus web UI and CLI are English-only. This PR adds web i18n (English + Simplified Chinese, browser-language detection, persisted preference, header language switcher) and CLI i18n (env-var-driven locale, localized human-facing output for serve/status/list/remove/tool/doctor/clean). The stated goal is to make all GitNexus-owned user-facing text language-aware across both surfaces. Current PR state
Merge status and mergeabilityNot mergeable. The main CI workflow is Repository history considered
Branch hygiene assessmentClean PR diff, merge-from-main history present but harmless. All five i18n commits are scoped to i18n/test/locale files only. Understanding of the changeWeb layer: i18next with eager CLI layer: Custom User-facing page translation sweepLanding / repo selection / upload / drop
Analyze / onboarding / progress
Header / nav / language switcher
Graph exploration
File tree / code references / processes / right panel
Query / chat / FAB / tool calls
Settings / provider config
Help panel
Status / loading / error / reconnect / embedding / WebGPU / modals
CLI translation sweepAll human-facing CLI output confirmed localized: FindingsFinding 1 — CONFIRMED MERGE-BLOCKING:
|
|
@ChamHerry Pleas also run your sweep for all of the user-facing pages and make sure they are all translated 🙏 |
Localize the remaining PR abhigyanpatwari#1748 blocker strings and follow-up sweep findings without changing UI state or backend contracts. Keep technical examples and command tokens as-is while moving GitNexus-owned prose into locale resources. Constraint: Latest maintainer/Claude review requested all user-facing pages be swept for translation coverage. Rejected: Translating code/query examples and product names | they are technical identifiers and would reduce clarity. Confidence: high Scope-risk: moderate Directive: Add both en and zh-CN keys for any future GitNexus-owned visible prose, including title/placeholder/helper text. Tested: GitNexus impact analysis for MarkdownRenderer, SettingsPanel, RepoAnalyzer, FileTreePanel, CodeReferencesPanel, useAppState, and translateProgressMessage. Tested: custom TypeScript/JSX hardcoded user-facing text scan; blocker grep for prior review strings. Tested: cd gitnexus-web && npx prettier --check <changed files>. Tested: cd gitnexus-web && npx eslint <changed TS/TSX files> (warnings only, pre-existing style warnings). Tested: cd gitnexus-web && npx tsc -b --noEmit. Tested: cd gitnexus-web && npm test -- i18n.test.tsx; cd gitnexus-web && npm test. Tested: cd gitnexus-web && npm run test:e2e -- language-switching.spec.ts after starting Vite on localhost:5173. Tested: git diff --check; GitNexus detect_changes(scope=staged, repo=GitNexus). Not-tested: Full manual visual sweep in a browser for every panel; full backend/CLI test suites unchanged.
|
@magyargergo pushed Fixed:
Sweep results:
Validation:
CI is running on the new head now; Vercel still appears to require team authorization as before. |
|
Can you please check all the cli options ad well? 🙏 |
Add a regression sweep that enumerates every registered CLI help page and verifies zh-CN help no longer contains the original English command or option descriptions from the Commander registration files. Constraint: PR abhigyanpatwari#1748 follow-up asked to check all CLI options, not just sampled commands. Rejected: Manual-only CLI option review | it would not prevent future untranslated options from slipping in. Confidence: high Scope-risk: narrow Directive: Keep new CLI commands/options in the Commander registration files covered by help localization resources. Tested: GITNEXUS_LANG=zh-CN node --import tsx src/cli/index.ts <all commands> --help dynamic sweep. Tested: cd gitnexus && npx vitest run test/unit/cli-index-help.test.ts test/unit/cli-i18n.test.ts test/unit/cli-message.test.ts. Tested: cd gitnexus && npx tsc --noEmit. Tested: cd gitnexus && npx eslint test/unit/cli-index-help.test.ts. Tested: git diff --check; GitNexus detect_changes(scope=staged, repo=GitNexus). Not-tested: Full gitnexus npm test suite; no production code changed.
|
Follow-up for the CLI options request: pushed What I checked:
Result:
Added regression coverage:
Validation:
|
Summary
Why
GitNexus currently exposes both a web UI and CLI. Internationalization needs to cover both surfaces so users do not get mixed-language behavior after switching locale.
Stack / review note
This PR is submitted directly to upstream
mainper request, so it currently includes the prerequisite LadybugDB sidecar recovery commit from #1747:fix(lbug): keep serve stable when sidecars are missingIf #1747 lands first, this branch should be rebased onto upstream
mainso this PR becomes a pure i18n diff.Validation
cd gitnexus && npx vitest run test/unit/cli-i18n.test.ts test/unit/cli-message.test.ts && npx tsc --noEmitcd gitnexus-web && npm test && npx tsc -b --noEmitgitnexus-webandgitnexustypechecksNot tested
Follow-up / out of scope
These items are intentionally left out of this PR to keep the current i18n diff focused and reviewable:
error: stringresponse for compatibility, then update the webBackendError/assertOk/formatBackendErrorpath to translate by code instead of matching English messages. This should be a separate PR because the backend client error path has broad impact.setup,group, andwikicommand runtime output to the existing CLIt()resource system in staged follow-up PRs (setup->group->wiki). Keep machine-readable--jsonoutput, paths, env vars, model names, URLs, and raw external/tool/LLM messages unchanged.errors.jsonparity regression coverage: add a small test proving theenandzh-CNerror resources load the expected languages. No file swap is needed; the current files are not reversed.