Skip to content

Commit 78de481

Browse files
committed
fix: fix i18n duplicates
1 parent 9b21e93 commit 78de481

5 files changed

Lines changed: 66 additions & 18 deletions

File tree

web/src/MachineEditPage.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ class MachineEditPage extends React.Component {
9393
</Space>
9494
</div>
9595

96-
<Card size="small" title={renderCardTitle(i18next.t("general:General Settings"), i18next.t("machine:General Settings desc"))} style={sectionCardStyle} headStyle={cardHeadStyle}>
96+
<Card size="small" title={renderCardTitle(i18next.t("general:General Settings"), i18next.t("general:General Settings desc"))} style={sectionCardStyle} headStyle={cardHeadStyle}>
9797
<Row gutter={rowGutter}>
9898
{this.renderField(
99-
Setting.getLabel(i18next.t("general:Name"), i18next.t("machine:Name - Tooltip")),
99+
Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip")),
100100
<Input value={machine.name} disabled onChange={e => this.updateMachineField("name", e.target.value)} />,
101101
8
102102
)}
@@ -106,11 +106,11 @@ class MachineEditPage extends React.Component {
106106
8
107107
)}
108108
{this.renderField(
109-
Setting.getLabel(i18next.t("machine:Role"), i18next.t("machine:Role - Tooltip")),
109+
Setting.getLabel(i18next.t("policy:Role"), i18next.t("machine:Role - Tooltip")),
110110
<Select
111111
value={machine.role || undefined}
112112
allowClear
113-
placeholder={i18next.t("machine:Role")}
113+
placeholder={i18next.t("policy:Role")}
114114
style={{width: "100%"}}
115115
options={[
116116
{label: "master", value: "master"},

web/src/MachineListPage.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class MachineListPage extends React.Component {
139139
width: "120px",
140140
},
141141
{
142-
title: i18next.t("machine:Role"),
142+
title: i18next.t("policy:Role"),
143143
dataIndex: "role",
144144
key: "role",
145145
width: "120px",
@@ -206,19 +206,19 @@ class MachineListPage extends React.Component {
206206
destroyOnHidden
207207
>
208208
<Form ref={this.formRef} layout="vertical">
209-
<Form.Item label={i18next.t("general:Name")} name="name" rules={[{required: true, message: i18next.t("rbac:required")}, {pattern: /^[a-z0-9-]+$/, message: "lowercase letters, digits and dashes only"}]}>
209+
<Form.Item label={i18next.t("general:Name")} name="name" rules={[{required: true, message: i18next.t("policy:required")}, {pattern: /^[a-z0-9-]+$/, message: "lowercase letters, digits and dashes only"}]}>
210210
<Input placeholder="my-machine" />
211211
</Form.Item>
212212
<Form.Item label={i18next.t("general:Display name")} name="displayName">
213213
<Input placeholder="My Machine" />
214214
</Form.Item>
215-
<Form.Item label={i18next.t("machine:IP address")} name="ip" rules={[{required: true, message: i18next.t("rbac:required")}]}>
215+
<Form.Item label={i18next.t("machine:IP address")} name="ip" rules={[{required: true, message: i18next.t("policy:required")}]}>
216216
<Input placeholder="192.168.1.10" />
217217
</Form.Item>
218-
<Form.Item label={i18next.t("machine:SSH port")} name="port" rules={[{required: true, message: i18next.t("rbac:required")}]}>
218+
<Form.Item label={i18next.t("machine:SSH port")} name="port" rules={[{required: true, message: i18next.t("policy:required")}]}>
219219
<InputNumber style={{width: "100%"}} min={1} max={65535} />
220220
</Form.Item>
221-
<Form.Item label={i18next.t("machine:Username")} name="username" rules={[{required: true, message: i18next.t("rbac:required")}]}>
221+
<Form.Item label={i18next.t("machine:Username")} name="username" rules={[{required: true, message: i18next.t("policy:required")}]}>
222222
<Input placeholder="root" />
223223
</Form.Item>
224224
<Form.Item label={i18next.t("machine:Auth type")} name="authType">
@@ -229,11 +229,11 @@ class MachineListPage extends React.Component {
229229
</Form.Item>
230230
<Form.Item noStyle shouldUpdate={(prev, cur) => prev.authType !== cur.authType}>
231231
{({getFieldValue}) => getFieldValue("authType") === "privateKey" ? (
232-
<Form.Item label={i18next.t("machine:Private key")} name="privateKey" rules={[{required: true, message: i18next.t("rbac:required")}]}>
232+
<Form.Item label={i18next.t("machine:Private key")} name="privateKey" rules={[{required: true, message: i18next.t("policy:required")}]}>
233233
<Input.TextArea rows={4} placeholder="-----BEGIN OPENSSH PRIVATE KEY-----" />
234234
</Form.Item>
235235
) : (
236-
<Form.Item label={i18next.t("machine:Password")} name="password" rules={[{required: true, message: i18next.t("rbac:required")}]}>
236+
<Form.Item label={i18next.t("machine:Password")} name="password" rules={[{required: true, message: i18next.t("policy:required")}]}>
237237
<Input.Password />
238238
</Form.Item>
239239
)}

web/src/TrivyScanPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class TrivyScanPage extends React.Component {
8484
render: (v) => <Text code style={{wordBreak: "break-all"}}>{v}</Text>,
8585
},
8686
{
87-
title: i18next.t("trivy:Status"),
87+
title: i18next.t("general:Status"),
8888
dataIndex: "status",
8989
key: "status",
9090
width: 100,

web/src/locales/en/data.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"Content": "Content",
2626
"Content desc": "Page content configuration",
2727
"Cron Jobs": "Cron Jobs",
28-
"Horizontal Pod Autoscaler": "Horizontal Pod Autoscaler",
2928
"Dashboard": "Dashboard",
3029
"Delete": "Delete",
3130
"Deployments": "Deployments",
@@ -45,11 +44,13 @@
4544
"General Settings desc": "Basic site information",
4645
"HTML title": "HTML title",
4746
"HTML title - Tooltip": "Text shown in the browser tab and window title bar for this site",
47+
"Horizontal Pod Autoscaler": "Horizontal Pod Autoscaler",
4848
"Image": "Image",
4949
"Image Scan": "Image Scan",
5050
"Infrastructure": "Infrastructure",
5151
"Ingresses": "Ingresses",
5252
"Loading...": "Loading...",
53+
"Log Search": "Log Search",
5354
"Logo URL": "Logo URL",
5455
"Logo URL - Tooltip": "URL of the image displayed as the site logo in the header",
5556
"Machines": "Machines",
@@ -63,9 +64,9 @@
6364
"Nodes": "Nodes",
6465
"OK": "OK",
6566
"Persistent Volume Claims": "Persistent Volume Claims",
67+
"Pods": "Pods",
6668
"Resource Quotas": "Resource Quotas",
6769
"Role Bindings": "Role Bindings",
68-
"Pods": "Pods",
6970
"Save": "Save",
7071
"Secrets": "Secrets",
7172
"ServiceAccounts": "Service Accounts",
@@ -81,6 +82,27 @@
8182
"Sure to delete": "Sure to delete",
8283
"Workloads": "Workloads"
8384
},
85+
"machine": {
86+
"Add Machine": "Add Machine",
87+
"Auth type": "Auth type",
88+
"Auth type - Tooltip": "Auth type - Tooltip",
89+
"Edit Machine": "Edit Machine",
90+
"IP address": "IP address",
91+
"IP address - Tooltip": "IP address - Tooltip",
92+
"Operating system": "Operating system",
93+
"Operating system - Tooltip": "Operating system - Tooltip",
94+
"Password": "Password",
95+
"Password - Tooltip": "Password - Tooltip",
96+
"Private key": "Private key",
97+
"Private key - Tooltip": "Private key - Tooltip",
98+
"Role - Tooltip": "Role - Tooltip",
99+
"SSH Credentials": "SSH Credentials",
100+
"SSH Credentials desc": "SSH Credentials desc",
101+
"SSH port": "SSH port",
102+
"SSH port - Tooltip": "SSH port - Tooltip",
103+
"Username": "Username",
104+
"Username - Tooltip": "Username - Tooltip"
105+
},
84106
"policy": {
85107
"Add Rule": "Add Rule",
86108
"Delete this rule?": "Delete this rule?",
@@ -149,7 +171,6 @@
149171
"Scanned At": "Scanned At",
150172
"Severity": "Severity",
151173
"Start Scan": "Start Scan",
152-
"Status": "Status",
153174
"Title": "Title",
154175
"page desc": "Scans container images for known CVE vulnerabilities using Trivy. Images with CRITICAL findings are blocked by the Admission Webhook.",
155176
"scan may take minutes": "Scanning may take 1–3 minutes depending on the image size and vulnerability database."

web/src/locales/zh/data.json

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@
2525
"Content": "内容",
2626
"Content desc": "页面内容配置",
2727
"Cron Jobs": "定时任务",
28-
"Horizontal Pod Autoscaler": "水平自动伸缩",
2928
"Dashboard": "仪表盘",
3029
"Delete": "删除",
3130
"Deployments": "部署",
31+
"Description": "Description",
3232
"Display name": "显示名称",
3333
"Display name - Tooltip": "在界面中展示的友好名称,代替内部标识符显示给用户",
3434
"Edit": "编辑",
35+
"Failed to add": "Failed to add",
3536
"Failed to delete": "删除失败",
3637
"Failed to get": "获取失败",
3738
"Failed to save": "保存失败",
@@ -43,12 +44,16 @@
4344
"General Settings desc": "站点基本信息",
4445
"HTML title": "HTML标题",
4546
"HTML title - Tooltip": "显示在浏览器标签页和窗口标题栏中的文字",
47+
"Horizontal Pod Autoscaler": "水平自动伸缩",
4648
"Image": "镜像",
4749
"Image Scan": "镜像扫描",
50+
"Infrastructure": "Infrastructure",
4851
"Ingresses": "入口",
4952
"Loading...": "加载中...",
53+
"Log Search": "Log Search",
5054
"Logo URL": "Logo地址",
5155
"Logo URL - Tooltip": "显示在页头的Logo图片地址",
56+
"Machines": "Machines",
5257
"Name": "名称",
5358
"Name - Tooltip": "站点的唯一标识符,用于URL和API调用",
5459
"Namespaces": "命名空间",
@@ -59,9 +64,9 @@
5964
"Nodes": "节点",
6065
"OK": "确定",
6166
"Persistent Volume Claims": "存储卷",
67+
"Pods": "容器组",
6268
"Resource Quotas": "资源配额",
6369
"Role Bindings": "角色绑定",
64-
"Pods": "容器组",
6570
"Save": "保存",
6671
"Secrets": "密钥",
6772
"ServiceAccounts": "服务账户",
@@ -70,11 +75,34 @@
7075
"Stateful Sets": "有状态副本集",
7176
"Static base URL": "静态资源根地址",
7277
"Static base URL - Tooltip": "CDN或静态文件服务器的根地址,所有静态资源路径都以此为前缀",
78+
"Status": "Status",
79+
"Successfully added": "Successfully added",
7380
"Successfully deleted": "删除成功",
7481
"Successfully saved": "保存成功",
7582
"Sure to delete": "确认删除",
7683
"Workloads": "工作负载"
7784
},
85+
"machine": {
86+
"Add Machine": "Add Machine",
87+
"Auth type": "Auth type",
88+
"Auth type - Tooltip": "Auth type - Tooltip",
89+
"Edit Machine": "Edit Machine",
90+
"IP address": "IP address",
91+
"IP address - Tooltip": "IP address - Tooltip",
92+
"Operating system": "Operating system",
93+
"Operating system - Tooltip": "Operating system - Tooltip",
94+
"Password": "Password",
95+
"Password - Tooltip": "Password - Tooltip",
96+
"Private key": "Private key",
97+
"Private key - Tooltip": "Private key - Tooltip",
98+
"Role - Tooltip": "Role - Tooltip",
99+
"SSH Credentials": "SSH Credentials",
100+
"SSH Credentials desc": "SSH Credentials desc",
101+
"SSH port": "SSH port",
102+
"SSH port - Tooltip": "SSH port - Tooltip",
103+
"Username": "Username",
104+
"Username - Tooltip": "Username - Tooltip"
105+
},
78106
"policy": {
79107
"Add Rule": "添加规则",
80108
"Delete this rule?": "确认删除此规则?",
@@ -143,7 +171,6 @@
143171
"Scanned At": "扫描时间",
144172
"Severity": "严重等级",
145173
"Start Scan": "开始扫描",
146-
"Status": "状态",
147174
"Title": "漏洞描述",
148175
"page desc": "使用 Trivy 扫描容器镜像中的已知 CVE 漏洞。包含 CRITICAL 漏洞的镜像将被准入 Webhook 拦截,禁止部署。",
149176
"scan may take minutes": "扫描可能需要 1–3 分钟,取决于镜像大小和漏洞库状态。"

0 commit comments

Comments
 (0)