yyqdbngt opened a new pull request, #2973:
URL: https://github.com/apache/rocketmq-dashboard/pull/2973
## Summary
Replace hard-coded Chinese pagination total texts across the instance and
studio pages with localized `t()` calls, and add the corresponding translation
entries:
- `common.totalUsers` / `common.totalGroups` / `common.totalMessages` /
`common.totalRules` interpolation keys (zh + en)
- Applied in `consumer.tsx`, `dlq.tsx` (2 spots), `message.tsx`,
`topic.tsx`, `UserManagement.tsx`, `alerts.tsx`
- `LiteTopic.tsx`: replaced a manual `replace('{total}', ...)` with the
interpolation engine
- Kept `alerts.totalRules` as the plain stat label ("规则总数"/"Total Rules")
and introduced `common.totalRules` for the paged footer, so the header stat
never renders a leftover `{count}` placeholder
## Why
Pagination totals were hard-coded Chinese strings (`共 ${n} 个 Group`), so the
English UI still showed Chinese in the table footers. One change
(`alerts.totalRules`) originally re-purposed a key that is also rendered
without arguments as a header stat, which would have leaked a literal `{count}`
into the header; this PR splits the two uses.
## Testing
- `vitest run src/i18n/__tests__/LangContext.test.tsx
src/pages/ops/__tests__/AlertsPage.test.tsx
src/pages/studio/__tests__/UserManagement.test.tsx` → 3 files, 32 tests passed
(interpolation in both languages, no leftover placeholders, alerts stat + paged
footer)
- `tsc --noEmit` → clean
- `eslint` on changed files → 0 errors (only pre-existing
react-refresh/exhaustive-deps warnings)
--
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]