Wang1rrr opened a new pull request, #4803:
URL: https://github.com/apache/rocketmq-dashboard/pull/4803

   ### Which Issue(s) This PR Fixes
   
   No issue - continues the localization pass from #4621, #4629, #4633 and 
#4802.
   
   ### Brief Description
   
   `web/src/pages/settings/AboutTab.tsx` was the only settings tab that never 
imported the language context. Six `Descriptions.Item` labels, the "related 
links" heading and two link captions were string literals, so switching the 
console to English left them in Chinese.
   
   They move into `settings.about*` keys placed next to `settings.tabAbout`, 
following the namespace the other settings tabs already use 
(`settings.credentialExportFailed`, `settings.themeMode`, ...). The component 
gains a body so it can call `useLang()`; prettier reindents the JSX.
   
   Left alone deliberately:
   
   - `label="License"` - the same word in both locales.
   - the `GitHub` caption - a brand name.
   - the copyright line - the ASF legal notice, which should not be translated.
   
   The Chinese values are moved verbatim from the component rather than 
rewritten, so the zh console is pixel-identical; only the English text is new.
   
   ### How Did You Test This Change?
   
   Added `reads every label from the language context` to `AboutTab.test.tsx`, 
which mocks `useLang` to an identity `t` (the pattern 
`src/pages/login/index.test.tsx` uses) and asserts all nine keys reach the DOM 
- a literal left in the component would render as text instead of a key and 
fail.
   
   ```
   cd web
   npx vitest run src/pages/settings/__tests__/AboutTab.test.tsx 
src/pages/settings/__tests__/SettingsPage.test.tsx
    Test Files  2 passed (2)
         Tests  3 passed (3)
   
   npx tsc -b                                        # exit 0
   npx eslint src/pages/settings/AboutTab.tsx 
src/pages/settings/__tests__/AboutTab.test.tsx src/i18n/translations.ts   # 
exit 0
   npx prettier --check <the three files>            # clean
   ```
   
   Baseline for reference, unchanged by this diff: `npm test` on the trunk 
gives 139 files / 1280 tests passing.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks) - N/A, frontend only
   - [ ] New source files carry the ASF license header - N/A, no new files
   - [ ] Documentation touched where behaviour changed - N/A, no documented 
contract changed
   


-- 
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]

Reply via email to