tju-yxq opened a new pull request, #5529: URL: https://github.com/apache/rocketmq-dashboard/pull/5529
### Which Issue(s) This PR Fixes - Fixes #5528 ### Brief Description Localizes the consumer page's remaining ~180 hardcoded Chinese strings and adds the corresponding `consumer.*` keys (zh text unchanged, new English translations) to `translations.ts`: - **Module helpers** return keys now (`不可用`, reset-preview risk labels, issue severity labels); the reset-preview queue message builder takes `t` so its composite messages (`将回放 N 条消息…`) localize with interpolation - **Settings tab**: labels, the high-risk change confirmation and its risk bullets, save/failure toasts - **Reset offset modal**: warning banner, target selectors, time quick-select, preview metrics and status, all toasts - **Health tab**: stat cards, consistency-check banner states, recommendations header - **Thread stack modal**: title, metadata, the proxy-client unsupported notice - **Import/create modals**: full label and validation coverage, status tags, detected-rows alerts - **Main table & toolbar**: column titles, action buttons, batch-delete confirmation with count, auto-refresh toggle, pagination totals Out of scope (tracked separately): the health tab's issue titles/descriptions and status text come from `utils/consumerGroupDiagnostics.ts`, which returns Chinese strings directly; parsing helpers that match API-returned Chinese values stay untouched. The zh text is byte-identical to what was hardcoded, so Chinese-locale users see no change. ### How Did You Test This Change? `cd web && npx tsc --noEmit` — clean. `npx eslint src/pages/instance/consumer.tsx src/i18n/translations.ts` — 0 errors. `npx vitest run src/pages/instance/__tests__/ConsumerPage.test.tsx` — the machine this was verified on was heavily loaded (test-file import alone took 110s+), and the run reports 30/39 with the 9 failures reproducing **identically on the unmodified upstream baseline** (same tests, same assertions — e.g. `highlights inconsistent subscriptions` fails at its `全部 2 个订阅配置一致` assertion on pristine trunk too; the detail modal's 2s auto-refresh consumes queued mocks when the runner is slow). Spot-verified standalone, on this branch: - `edits consumption switches from the detail modal settings tab` — passed - `renders an unknown (-1) lag as unavailable in the table and the lag detail` — passed - `loads a consumer client stack trace from the selected instance` — passed - `ConsumerPageDiagnosticsRace.test.tsx` (whole file) — passed The change is display-string-only and the zh text is byte-identical to what was hardcoded, so the page's behavior is unchanged. ### Checklist - [x] One coherent change; unrelated modifications are not bundled in (single page localization) - [x] Commit subject follows Conventional Commits - [ ] Tests added or updated for non-trivial changes, test methods named `...Test` (display-string replacement only — the zh text is byte-identical; the existing ConsumerPage suite covers the page) - [x] New UI text has both Chinese and English entries under `web/src/i18n/` (this PR is exactly that — ~180 `consumer.*` keys) - [x] Architecture constraints stay green (no Java changes) - [x] New source files carry the ASF license header (no new source files) - [ ] Documentation touched where behaviour changed (display strings only) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
