tju-yxq opened a new issue, #5582:
URL: https://github.com/apache/rocketmq-dashboard/issues/5582

   ## Problem
   
   The axios response interceptor (`api/client.ts`) — the single choke point 
every API error in the console flows through — carries two hardcoded Chinese 
strings:
   
   1. **The business-error fallback** (`请求失败`): when the server returns an 
error envelope whose `message` is blank, the interceptor toasts `请求失败` 
regardless of the display language. Every page inherits this, so an 
English-locale operator sees a Chinese toast for any backend error that omits 
its message.
   
   2. **The CORS rejection hint** (`请求被服务端 CORS 策略拒绝(Invalid CORS 
request):当前访问地址不在后端白名单,请检查部署的 STUDIO_CORS_ALLOWED_ORIGONS 配置`): a full 
Chinese-only diagnostic, toasted and written into `error.message` whenever a 
403 arrives without the business envelope. This is the 
deployment-misconfiguration case — the moment an operator most needs to read 
the hint, an English user gets Chinese.
   
   Both strings predate the i18n layer and sit outside React, so they never 
went through it.
   
   ## Expected Behavior
   
   Both fallbacks resolve through `translations.ts` at error time. The 
interceptor lives outside React, so it reads the persisted language preference 
(`getInitialLanguage()`, the same source `LangProvider` initializes from) when 
the toast actually renders — meaning a language switch takes effect on the next 
error without any React coupling. Two new keys: `common.requestFailed` and 
`common.corsRejectionHint` (the latter gains an English rendering for the first 
time).
   
   The zh text is byte-identical; English-locale users get English for both 
cases.
   


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