unbridled-41 opened a new issue, #4841:
URL: https://github.com/apache/rocketmq-dashboard/issues/4841
### Studio Version
Branch `rocketmq-studio` (development trunk), commit `4c697f07`.
### Runtime Environment
Front-end only: `web/src/pages/ops/alerts.tsx` +
`web/src/i18n/translations.ts`. Any browser.
### Describe the Bug
The alerts-page pagination footer renders the server total through the i18n
label:
```ts
showTotal={(total) => t('alerts.totalRules', { count: total })}
```
but the translation carries no placeholder:
```ts
'alerts.totalRules': { zh: '规则总数', en: 'Total Rules' },
```
`t()` performs a plain `String.replace('{count}', …)` loop, which is a no-op
when the template lacks the placeholder — the footer shows only "规则总数" / "Total
Rules" and **the total number is silently dropped**. Verified by simulating
`t('alerts.totalRules', { count: 21 })` → output is exactly `"规则总数"` (no `21`
anywhere in the footer text). The header stat block directly above *does* show
the number in a separate span, making the omission visible on every page load.
### Steps to Reproduce
1. Open the alerts page (either domain) with any page result.
2. Look at the pagination footer at the bottom-right of the table.
3. Observe the label "规则总数" / "Total Rules" with no number, while the header
stat shows the total.
### What Did You Expect to See?
The pagination footer renders the substituted label, e.g. "规则总数 21" / "Total
Rules 21", consistently with the header stat.
### What Did You See Instead?
Only the bare label; the count never appears in the footer.
### Additional Context
Proposed fix in PR #4832: add the `{count}` placeholder to
`alerts.totalRules` and render the header stat through the same substituted
label so the count appears wherever the label does. Note: the footer assertion
in the pre-existing test `loads a server-side page and filters by status and
search` (`expect(screen.getByText('21'))`) matched only the header stat's
separate span, which is why the missing footer number went unnoticed.
--
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]