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

   ### Summary
   Localize the two user-facing error strings produced by the shared axios 
client (`web/src/api/client.ts`), which surface as toast messages on 
essentially every page:
   
   - The generic business-error fallback `请求失败` now resolves through the new 
`api.requestFailed` key (default-zh safe).
   - The CORS-rejection hint is no longer a module-level Chinese constant; it 
is resolved per occurrence through the `api.corsRejection` key with the current 
UI language (read via `getInitialLanguage`, so toggling language applies 
without a rebuild).
   - Added a small `apiText(key)` helper that reads the current stored language 
on each call, keeping the module hook-free.
   
   ### Why
   These two strings were the only remaining hardcoded Chinese in the shared 
request layer, so every English-mode page could still toast Chinese for 
network/business failures; the CORS hint especially matters for cross-origin 
deployments.
   
   ### Testing
   - `tsc --noEmit` passes (exit 0).
   - `eslint` clean on changed files (0 errors).
   - Vitest: `api/client.test.ts` passes (14/14), including the request-failed 
fallback and CORS-hint assertions (default zh preserved).
   


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