You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "yyqdbngt (via GitHub)" <gi...@apache.org> on 2026/09/02 04:24:47 UTC

[PR] fix(i18n): localize pagination totals across instance and studio pages [rocketmq-dashboard]

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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(i18n): localize pagination totals across instance and studio pages [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #2973: fix(i18n): localize pagination totals across instance and studio pages
URL: https://github.com/apache/rocketmq-dashboard/pull/2973


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org