hussnainahmedd opened a new pull request, #702:
URL: https://github.com/apache/shenyu-dashboard/pull/702

   Closes #701.
   
   ### What this PR does
   Replaces hardcoded Chinese user-facing strings with the existing 
`getIntlContent()` i18n mechanism so they follow the selected locale, and adds 
the five translation keys the app references but that were missing from both 
locale files.
   
   **Hardcoded strings fixed:**
   - `src/utils/request.js` — HTTP status descriptions (200–504) and the 
request-error notification title. (Note: the status map is now built at call 
time via `getCodeMessage()` so it resolves after intl init and follows locale 
switches, instead of being frozen at module load.)
   - `src/utils/download.js` — request-error notification title and 
download-failure error prefix.
   - `src/routes/Plugin/McpServer/McpConfigModal.js` — gateway address label, 
input placeholder, current-address line, enabled/disabled states, base path 
label, URL explanation; generated service names/descriptions and the 
default-service fallback now resolve through i18n keys (verified these values 
are only rendered/copied in this dialog — nothing else matches on the Chinese 
text).
   - `src/routes/Plugin/McpServer/ToolsModal.js` — nesting-depth and 
incomplete-parameter validation messages. Dynamic values (row numbers, depth 
limits) are preserved by composing translated fragments around the numbers, 
since the repo's `getIntlContent` wrapper has no interpolation support.
   - `src/components/Exception/*` — 403/404/500 descriptions and the back-home 
button (`typeConfig` is now a function so descriptions resolve at render time 
in the current locale).
   - `src/routes/System/Resource/index.js` — select-a-menu warning.
   - `src/routes/System/Instance/index.js` — chart y-axis name.
   
   **Missing keys added to both `en-US.json` and `zh-CN.json` (48 new keys 
total, key sets kept in sync):**
   `SHENYU.SYSTEM.ALERT.LABELS.NAME`, `SHENYU.SYSTEM.ALERT.LABELS.VALUE`, 
`SHENYU.COMMON.SAVE`, `SHENYU.SYSTEM.DESCRIBE`, `SHENYU.COMMON.BACK` — these 
are already referenced by `Alert/AddModal.js` and `AiProxy/ApiKeys/index.js`.
   
   ### Verification
   - `eslint` on all touched files: 0 errors (2 pre-existing `no-console` 
warnings in `ToolsModal.js` untouched).
   - `node --check` on all touched files: pass.
   - Rendered every composed message in both locales with a script — English 
and Chinese outputs verified correct, dynamic values (row numbers, depth 
limits, status codes) preserved.
   - Left untouched per the issue: language self-names, Chinese code comments, 
test fixtures.
   
   ### Screenshots
   UI-only string changes; no visual layout changes. Happy to provide 
screenshots of the affected dialogs if helpful.
   


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