Copilot commented on code in PR #702:
URL: https://github.com/apache/shenyu-dashboard/pull/702#discussion_r4238456584


##########
src/routes/System/Instance/index.js:
##########
@@ -257,7 +257,7 @@ export default class Instance extends Component {
         max: 4,
         minInterval: 1,
         interval: 1,
-        name: "数量",
+        name: getIntlContent("SHENYU.SYSTEM.INSTANCE.CHART.COUNT"),

Review Comment:
   This translation is only evaluated when `renderLineChart` calls `setOption`. 
On a language change, `componentDidUpdate` rebuilds the table columns but does 
not call `renderLineChart`, and that method otherwise runs only when 
`instance.lineData` changes. Consequently, an already-rendered chart keeps the 
previous locale's y-axis label until new analysis data arrives. Reapply the 
line-chart option when `language` changes (and ideally do the same for the 
other translated chart labels).



##########
src/utils/download.js:
##########
@@ -34,7 +35,7 @@ async function checkStatus(response) {
   const errorText =
     (errorResponse && errorResponse.message) || response.statusText;
   notification.error({
-    message: `请求错误 ${response.status}: ${response.url}`,
+    message: `${getIntlContent("SHENYU.REQUEST.ERROR")} ${response.status}: 
${response.url}`,

Review Comment:
   The existing unauthorized-download test still asserts the literal 
notification message `请求错误 401: undefined` 
(`src/utils/download.test.js:115-118`). This line now emits the 
locale-dependent value, but the test neither initializes nor mocks `IntlUtils`, 
so the current suite will no longer satisfy that assertion. Update the test to 
initialize a locale or mock `getIntlContent`, and assert the translated 
notification.



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