tju-yxq opened a new pull request, #5581:
URL: https://github.com/apache/rocketmq-dashboard/pull/5581
### Which Issue(s) This PR Fixes
- Fixes #5580
### Brief Description
Migrates the home page's five leftover inline language branches to the
shared translation table:
- The greeting suffix becomes `home.welcomeSuffix` (`,欢迎` / `, welcome`).
- The AI composer's placeholder adopts the **existing** `home.placeholder`
key instead of a drifted inline copy (the inline English had already diverged:
`— encrypted` vs the key's `, fully encrypted`); the English wording now comes
from the key.
- The voice-input tooltip becomes `home.voiceInputTitle` (`语音输入(暂未支持)` /
`Voice input (not supported yet)`) — distinct from the existing
`home.voiceNotSupported` used by the click message.
- The footer build line, previously **Chinese-only**, becomes
`home.buildVersion` with `{time}` / `{commit}` placeholders and gains an
English rendering (`Version {time} build({commit})`).
- The half-ternary `{lang === 'zh' ? t('home.welcomeTo') : 'to'}` collapses
to `{t('home.welcomeTo')}` — the `t()` call already resolves English.
The Chinese render is byte-identical everywhere; the page no longer contains
any `lang ===` display branch.
### How Did You Test This Change?
```
cd web && npx vitest run src/pages/home/__tests__/HomePage.test.tsx
Test Files 1 passed (1)
Tests 9 passed (9)
cd web && npx eslint src/pages/home/index.tsx src/i18n/translations.ts
(no output — 0 errors, 0 warnings)
cd web && npx tsc --noEmit
(no output — exit 0)
```
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in (one
page's leftover inline branches, completing its localization)
- [x] Commit subject follows Conventional Commits
- [ ] Tests added or updated for non-trivial changes, test methods named
`...Test` (display-string replacement; the zh render is byte-identical and the
existing HomePage suite covers the page)
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
(three new `home.*` 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]