This is an automated email from the ASF dual-hosted git repository.

lizhimins pushed a commit to branch rocketmq-studio
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git


The following commit(s) were added to refs/heads/rocketmq-studio by this push:
     new da43b1ea0 fix(studio): localize the remaining hardcoded strings on 
Ops, BrokerCluster and AlertRuleAssets (#4629)
da43b1ea0 is described below

commit da43b1ea0e8911914942eb1ddded799f3142fc17
Author: Apulupie <[email protected]>
AuthorDate: Mon Sep 21 21:07:21 2026 +0800

    fix(studio): localize the remaining hardcoded strings on Ops, BrokerCluster 
and AlertRuleAssets (#4629)
    
    Three strings on otherwise fully localized pages were still Chinese 
literals: the `message` and `description` of the Alert in `Ops.tsx` that 
reports an unavailable runtime configuration, the instance `Select`'s 
`aria-label` and `placeholder` in `BrokerCluster.tsx`, and the `PageHeader` 
subtitle in `AlertRuleAssets.tsx`. Each page already calls `useLang()` for 
everything else, so an English UI showed exactly these three in Chinese.
    
    They now resolve through `t()`, using three new keys in `translations.ts` — 
`ops.unavailableTitle`, `ops.unavailableDescription`, `alertAssets.subtitle`, 
both languages — plus the existing `common.selectInstance` for the selector. 
The Chinese values match the removed literals verbatim, so the zh UI is 
unchanged, and the server-supplied `unavailableReason` still takes precedence 
over the description. No Chinese remains in the three files, comments included.
    
    Fixes #4630
---
 web/src/i18n/translations.ts             | 9 +++++++++
 web/src/pages/studio/AlertRuleAssets.tsx | 2 +-
 web/src/pages/studio/BrokerCluster.tsx   | 4 ++--
 web/src/pages/studio/Ops.tsx             | 4 ++--
 4 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/web/src/i18n/translations.ts b/web/src/i18n/translations.ts
index 6dbe72543..b341a428a 100644
--- a/web/src/i18n/translations.ts
+++ b/web/src/i18n/translations.ts
@@ -2552,6 +2552,11 @@ const translations: Record<string, Record<Lang, string>> 
= {
     en: 'Please input a new NameServer address',
   },
   'ops.fetchFailed': { zh: '获取运维数据失败', en: 'Failed to fetch ops data' },
+  'ops.unavailableTitle': { zh: '运行时配置不可用', en: 'Runtime configuration 
unavailable' },
+  'ops.unavailableDescription': {
+    zh: '当前集群不支持读取或更新 Ops 配置。',
+    en: 'This cluster does not support reading or updating Ops configuration.',
+  },
 
   // ─── Alert Management ───
   'alertMgmt.title': { zh: '告警规则管理', en: 'Alert Management' },
@@ -2617,6 +2622,10 @@ const translations: Record<string, Record<Lang, string>> 
= {
   'grafana.exportAllFailed': { zh: '导出全部看板失败', en: 'Failed to export 
dashboards' },
   // ─── Alert rule templates ───
   'alertAssets.title': { zh: '业务告警', en: 'Business Alerts' },
+  'alertAssets.subtitle': {
+    zh: '可复用的业务告警规则模板资产',
+    en: 'Reusable business alert rule template assets',
+  },
   'alertAssets.name': { zh: '名称', en: 'Name' },
   'alertAssets.group': { zh: '规则组', en: 'Group' },
   'alertAssets.ruleCount': { zh: '规则数', en: 'Rules' },
diff --git a/web/src/pages/studio/AlertRuleAssets.tsx 
b/web/src/pages/studio/AlertRuleAssets.tsx
index 85009537b..3a0d4c2d5 100644
--- a/web/src/pages/studio/AlertRuleAssets.tsx
+++ b/web/src/pages/studio/AlertRuleAssets.tsx
@@ -26,7 +26,7 @@ const AlertRuleAssetsPage: React.FC = () => {
 
   return (
     <div style={{ padding: 24 }}>
-      <PageHeader title={t('alertAssets.title')} subtitle="可复用的业务告警规则模板资产" />
+      <PageHeader title={t('alertAssets.title')} 
subtitle={t('alertAssets.subtitle')} />
       <Card styles={{ body: { padding: 0 } }}>
         <div style={{ padding: 16 }}>
           <AlertRuleAssetList />
diff --git a/web/src/pages/studio/BrokerCluster.tsx 
b/web/src/pages/studio/BrokerCluster.tsx
index 99c6daa56..0db75bc92 100644
--- a/web/src/pages/studio/BrokerCluster.tsx
+++ b/web/src/pages/studio/BrokerCluster.tsx
@@ -523,10 +523,10 @@ const BrokerClusterPage = () => {
         </h2>
         <Space size="middle">
           <Select
-            aria-label="选择实例"
+            aria-label={t('common.selectInstance')}
             value={selectedInstanceId}
             onChange={setSelectedInstanceId}
-            placeholder="选择实例"
+            placeholder={t('common.selectInstance')}
             style={{ minWidth: 180 }}
             options={instances.map((instance) => ({ value: instance.name, 
label: instance.name }))}
           />
diff --git a/web/src/pages/studio/Ops.tsx b/web/src/pages/studio/Ops.tsx
index 0f7bd61b5..880a2951f 100644
--- a/web/src/pages/studio/Ops.tsx
+++ b/web/src/pages/studio/Ops.tsx
@@ -195,8 +195,8 @@ const OpsPage: React.FC = () => {
         <Alert
           type="info"
           showIcon
-          message="运行时配置不可用"
-          description={unavailableReason || '当前集群不支持读取或更新 Ops 配置。'}
+          message={t('ops.unavailableTitle')}
+          description={unavailableReason || t('ops.unavailableDescription')}
           style={{ marginBottom: 24 }}
         />
       )}

Reply via email to