Skip to content

Commit f843438

Browse files
authored
Refine English translation (#8991)
* Refine English translation (#7232) * Refine English translation (#7247) * Refine pluralization of some English words (#7318) * Refine plural translation of English words * Remove useless i18n modifier * Refine English translation again and again (#7353) * Replace whitelist and blacklist with allowlist and blocklist (#7358) * Refine English translation and UI style (#7399) * Resolve build error * Fix build error
1 parent 4528f1f commit f843438

File tree

66 files changed

+1122
-1020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1122
-1020
lines changed

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"vue-clipboard3": "^2.0.0",
5757
"vue-codemirror": "^6.1.1",
5858
"vue-demi": "^0.14.6",
59-
"vue-i18n": "^9.13.1",
59+
"vue-i18n": "^10.0.5",
6060
"vue-router": "^4.3.3",
6161
"vue-virtual-scroller": "^2.0.0-beta.8"
6262
},

frontend/src/components/group/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<DrawerPro v-model="open" :header="$t('commons.table.group')" @close="handleClose" size="large">
2+
<DrawerPro v-model="open" :header="$t('commons.table.manageGroup')" @close="handleClose" size="large">
33
<template #content>
44
<ComplexTable :data="data" @search="search()">
55
<template #toolbar>

frontend/src/components/v-charts/components/Line.vue

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as echarts from 'echarts';
77
import { GlobalStore } from '@/store';
88
import { computeSizeFromKBs, computeSizeFromKB, computeSizeFromMB } from '@/utils/util';
99
import { storeToRefs } from 'pinia';
10+
import i18n from '@/lang';
1011
const globalStore = GlobalStore();
1112
const { isDarkTheme } = storeToRefs(globalStore);
1213
@@ -153,17 +154,35 @@ function initChart() {
153154
switch (props.option.formatStr) {
154155
case 'KB/s':
155156
for (const item of datas) {
156-
res += item.marker + ' ' + item.seriesName + '' + computeSizeFromKBs(item.data) + '<br/>';
157+
res +=
158+
item.marker +
159+
' ' +
160+
item.seriesName +
161+
i18n.global.t('commons.colon') +
162+
computeSizeFromKBs(item.data) +
163+
'<br/>';
157164
}
158165
break;
159166
case 'KB':
160167
for (const item of datas) {
161-
res += item.marker + ' ' + item.seriesName + '' + computeSizeFromKB(item.data) + '<br/>';
168+
res +=
169+
item.marker +
170+
' ' +
171+
item.seriesName +
172+
i18n.global.t('commons.colon') +
173+
computeSizeFromKB(item.data) +
174+
'<br/>';
162175
}
163176
break;
164177
case 'MB':
165178
for (const item of datas) {
166-
res += item.marker + ' ' + item.seriesName + '' + computeSizeFromMB(item.data) + '<br/>';
179+
res +=
180+
item.marker +
181+
' ' +
182+
item.seriesName +
183+
i18n.global.t('commons.colon') +
184+
computeSizeFromMB(item.data) +
185+
'<br/>';
167186
}
168187
break;
169188
default:
@@ -172,7 +191,7 @@ function initChart() {
172191
item.marker +
173192
' ' +
174193
item.seriesName +
175-
'' +
194+
i18n.global.t('commons.colon') +
176195
item.data +
177196
props.option.formatStr +
178197
'<br/>';

frontend/src/lang/modules/en.ts

Lines changed: 790 additions & 801 deletions
Large diffs are not rendered by default.

frontend/src/lang/modules/zh-Hant.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const message = {
44
commons: {
55
true: '是',
66
false: '否',
7-
example: '例:',
7+
colon: ':',
8+
example: '例如:',
89
fit2cloud: '飞致云',
910
lingxia: '凌霞',
10-
colon: ': ',
1111
button: {
1212
run: '執行',
1313
prev: '上一步',
@@ -446,7 +446,7 @@ const message = {
446446
loadBackup: '導入備份',
447447
remoteAccess: '遠程訪問',
448448
remoteHelper: '多個 ip 以逗號分隔,例:172.16.10.111,172.16.10.112',
449-
remoteConnHelper: 'root 帳號遠程連接 mysql 有安全風險,開啟需謹慎!',
449+
remoteConnHelper: 'root 帳號遠程連接 MySQL 有安全風險,開啟需謹慎!',
450450
changePassword: '改密',
451451
changeConnHelper: '此操作將修改當前資料庫 {0},是否繼續?',
452452
changePasswordHelper: '當前數據庫已經關聯應用,修改密碼將同步修改應用中數據庫密碼,修改後重啟生效。',
@@ -464,6 +464,7 @@ const message = {
464464
passwordHelper: '無法獲取密碼,請修改',
465465
remote: '遠程',
466466
remoteDB: '遠程服務器',
467+
manageRemoteDB: '管理遠程服務器',
467468
createRemoteDB: '添加遠程服務器',
468469
unBindRemoteDB: '解綁遠程服務器',
469470
unBindForce: '強制解綁',
@@ -940,6 +941,7 @@ const message = {
940941
taskType: '任務類型',
941942
nextTime: '近 5 次執行',
942943
record: '報告',
944+
viewRecords: '查看報告',
943945
shell: 'Shell 腳本',
944946
log: '備份日誌',
945947
logHelper: '備份系統日誌',
@@ -1203,6 +1205,7 @@ const message = {
12031205
'ClamAV 的最低建議配置為:3 GiB 以上的 RAM,2.0 GHz 以上的單核 CPU,以及至少 5 GiB 的可用硬盤空間。',
12041206
notStart: '當前未 ClamAV 服務,請先開啟!',
12051207
removeRecord: '刪除報告文件',
1208+
noRecords: '點擊“執行”按鈕開始掃描,掃描結果將會記錄在這裏。',
12061209
removeResultHelper: '刪除任務執行過程中生成的報告文件,以清理存儲空間。',
12071210
removeInfected: '刪除病毒文件',
12081211
removeInfectedHelper: '刪除任務檢測到的病毒文件,以確保伺服器的安全和正常運行。',
@@ -1278,9 +1281,12 @@ const message = {
12781281
dir: '文件夾',
12791282
upload: '上傳',
12801283
download: '下載',
1284+
uploadFile: '@:file.upload@:file.file',
1285+
uploadDirectory: '@:file.upload@:file.dir',
12811286
fileName: '文件名',
12821287
search: '在當前目錄下查找',
12831288
mode: '權限',
1289+
editPermissions: '編輯@:file.mode',
12841290
owner: '所有者',
12851291
file: '文件',
12861292
remoteFile: '遠程下載',
@@ -1651,6 +1657,7 @@ const message = {
16511657
deleteHelper: '將刪除該快照的所有備份文件,包括第三方備份賬號中的文件。',
16521658
status: '快照狀態',
16531659
ignoreRule: '排除規則',
1660+
editIgnoreRule: '@:commons.button.edit@:setting.ignoreRule',
16541661
ignoreHelper: '快照時將使用該規則對 1Panel 數據目錄進行壓縮備份,請謹慎修改。',
16551662
ignoreHelper1: '一行一個,例: \n*.log\n/opt/1panel/cache',
16561663
panelInfo: '寫入 1Panel 基礎信息',
@@ -2171,7 +2178,7 @@ const message = {
21712178
disabled: '已停止',
21722179
startProxy: '開啟反向代理',
21732180
stopProxy: '關閉反向代理',
2174-
proxyFile: '源文',
2181+
sourceFile: '源文',
21752182
proxyHelper1: '訪問這個目錄時將會把目標URL的內容返回並顯示',
21762183
proxyPassHelper: '代理的站點,必須為可正常訪問的URL',
21772184
proxyHostHelper: '將域名添加到請求頭傳遞到代理服務器',
@@ -2478,8 +2485,11 @@ const message = {
24782485
addressHelper2: '多個 IP 或 IP 段 請用 "," 隔開:172.16.10.11,172.16.0.0/24',
24792486
allIP: '所有 IP',
24802487
portRule: '端口規則',
2488+
createPortRule: '@:commons.button.create@:firewall.portRule',
24812489
forwardRule: '端口轉發',
2490+
createForwardRule: '@:commons.button.create@:firewall.forwardRule',
24822491
ipRule: 'IP 規則',
2492+
createIpRule: '@:commons.button.create @:firewall.ipRule',
24832493
userAgent: 'User-Agent 過濾',
24842494
sourcePort: '來源端口',
24852495
targetIP: '目標 IP',
@@ -2587,6 +2597,7 @@ const message = {
25872597
laddr: '本地地址/端口',
25882598
raddr: '远程地址/端口',
25892599
stopProcess: '結束',
2600+
viewDetails: '查看詳情',
25902601
stopProcessWarn: '是否確定結束此進程 (PID:{0})?',
25912602
processName: '進程名稱',
25922603
},

frontend/src/lang/modules/zh.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const message = {
44
commons: {
55
true: '是',
66
false: '否',
7+
colon: ':',
78
example: '例:',
89
fit2cloud: '飞致云',
910
lingxia: '凌霞',
10-
colon: ': ',
1111
button: {
1212
run: '运行',
1313
prev: '上一步',
@@ -126,8 +126,8 @@ const message = {
126126
protocol: '协议',
127127
tableSetting: '列表设置',
128128
refreshRate: '刷新频率',
129-
noRefresh: '不刷新',
130129
selectColumn: '选择列',
130+
noRefresh: '不刷新',
131131
local: '本地',
132132
serialNumber: '序号',
133133
},
@@ -444,7 +444,7 @@ const message = {
444444
loadBackup: '导入备份',
445445
remoteAccess: '远程访问',
446446
remoteHelper: '多个 ip 以逗号分隔,例:172.16.10.111,172.16.10.112',
447-
remoteConnHelper: 'root 帐号远程连接 mysql 有安全风险,开启需谨慎!',
447+
remoteConnHelper: 'root 帐号远程连接 MySQL 有安全风险,开启需谨慎!',
448448
changePassword: '改密',
449449
changeConnHelper: '此操作将修改当前数据库 {0},是否继续?',
450450
changePasswordHelper: '当前数据库已经关联应用,修改密码将同步修改应用中数据库密码,修改后重启生效。',
@@ -462,6 +462,7 @@ const message = {
462462
passwordHelper: '无法获取密码,请修改',
463463
remote: '远程',
464464
remoteDB: '远程服务器',
465+
manageRemoteDB: '管理远程服务器',
465466
createRemoteDB: '添加远程服务器',
466467
unBindRemoteDB: '解绑远程服务器',
467468
unBindForce: '强制解绑',
@@ -938,6 +939,7 @@ const message = {
938939
taskType: '任务类型',
939940
nextTime: '近 5 次执行',
940941
record: '报告',
942+
viewRecords: '查看报告',
941943
shell: 'Shell 脚本',
942944
log: '备份日志',
943945
logHelper: '备份系统日志',
@@ -1201,6 +1203,7 @@ const message = {
12011203
'ClamAV 的最低建议配置为:3 GiB 以上的 RAM,2.0 GHz 以上的单核 CPU,以及至少 5 GiB 的可用硬盘空间',
12021204
notStart: '当前未开启 ClamAV 服务,请先开启!',
12031205
removeRecord: '删除报告文件',
1206+
noRecords: '点击“执行”按钮开始扫描,扫描结果将会记录在这里。',
12041207
removeResultHelper: '删除任务执行过程中生成的报告文件,以清理存储空间。',
12051208
removeInfected: '删除病毒文件',
12061209
removeInfectedHelper: '删除任务检测到的病毒文件,以确保服务器的安全和正常运行。',
@@ -1277,6 +1280,7 @@ const message = {
12771280
fileName: '文件名',
12781281
search: '在当前目录下查找',
12791282
mode: '权限',
1283+
editPermissions: '编辑@:file.mode',
12801284
owner: '所有者',
12811285
file: '文件',
12821286
remoteFile: '远程下载',
@@ -1524,12 +1528,12 @@ const message = {
15241528
developerModeHelper: '获取 1Panel 的预览版本,以分享有关新功能和更新的反馈',
15251529

15261530
thirdParty: '第三方账号',
1531+
noTypeForCreate: '当前无可创建备份类型',
15271532
scope: '使用范围',
15281533
public: '公有',
15291534
publicHelper: '公有类型的备份账号会同步到各个子节点,子节点可以一起使用',
15301535
private: '私有',
15311536
privateHelper: '私有类型的备份账号只创建在当前节点上,仅供当前节点使用',
1532-
noTypeForCreate: '当前无可创建备份类型',
15331537
LOCAL: '服务器磁盘',
15341538
OSS: '阿里云 OSS',
15351539
S3: '亚马逊 S3 云存储',
@@ -1642,6 +1646,7 @@ const message = {
16421646
reRollback: '回滚快照失败',
16431647
deleteHelper: '将删除该快照的所有备份文件,包括第三方备份账号中的文件。',
16441648
ignoreRule: '排除规则',
1649+
editIgnoreRule: '@:commons.button.edit@:setting.ignoreRule',
16451650
ignoreHelper: '快照时将使用该规则对 1Panel 数据目录进行压缩备份,请谨慎修改。',
16461651
ignoreHelper1: '一行一个,例: \n*.log\n/opt/1panel/cache',
16471652
status: '快照状态',
@@ -2008,7 +2013,7 @@ const message = {
20082013
deleteApp: '删除应用',
20092014
deleteBackup: '删除备份',
20102015
domain: '域名',
2011-
domainHelper: '一行一个域名,支持*和IP地址,支持域名:端口',
2016+
domainHelper: '一行一个域名支持*和IP地址,支持"域名:端口"',
20122017
addDomain: '新增域名',
20132018
domainConfig: '域名设置',
20142019
defaultDoc: '默认文档',
@@ -2129,7 +2134,7 @@ const message = {
21292134
websiteDeploymentHelper: '使用从 1Panel 部署的应用创建网站',
21302135
websiteStatictHelper: '在主机上创建网站目录',
21312136
websiteProxyHelper:
2132-
'代理已有服务,例如本机已安装使用 8080 端口的 halo 服务,那么代理地址为 http://127.0.0.1:8080',
2137+
'代理已有服务例如本机已安装使用 8080 端口的 halo 服务,那么代理地址为 http://127.0.0.1:8080',
21332138
restoreHelper: '确认使用此备份恢复?',
21342139
wafValueHelper: '值',
21352140
runtimeProxyHelper: '使用从 1Panel 创建的运行环境',
@@ -2161,7 +2166,7 @@ const message = {
21612166
disabled: '已停止',
21622167
startProxy: '开启反向代理',
21632168
stopProxy: '关闭反向代理',
2164-
proxyFile: '源文',
2169+
sourceFile: '源文',
21652170
proxyHelper1: '访问这个目录时将会把目标URL的内容返回并显示',
21662171
proxyPassHelper: '代理的站点,必须为可正常访问的URL',
21672172
proxyHostHelper: '将域名添加到请求头传递到代理服务器',
@@ -2468,8 +2473,11 @@ const message = {
24682473
addressHelper2: '多个 IP 或 IP 段 请用 "," 隔开:172.16.10.11,172.16.0.0/24',
24692474
allIP: '所有 IP',
24702475
portRule: '端口规则',
2476+
createPortRule: '@:commons.button.create@:firewall.portRule',
24712477
forwardRule: '端口转发',
2478+
createForwardRule: '@:commons.button.create@:firewall.forwardRule',
24722479
ipRule: 'IP 规则',
2480+
createIpRule: '@:commons.button.create @:firewall.ipRule',
24732481
userAgent: 'User-Agent 过滤',
24742482
destination: '目的地',
24752483
sourcePort: '源端口',
@@ -2578,6 +2586,7 @@ const message = {
25782586
laddr: '本地地址/端口',
25792587
raddr: '远程地址/端口',
25802588
stopProcess: '结束',
2589+
viewDetails: '查看详情',
25812590
stopProcessWarn: '是否确定结束此进程 (PID:{0})?',
25822591
processName: '进程名称',
25832592
},

frontend/src/layout/components/Sidebar/components/SubItem.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<el-icon>
66
<SvgIcon :iconName="(subItem.meta?.icon as string)" />
77
</el-icon>
8-
<span>{{ $t(subItem.meta?.title as string) }}</span>
8+
<span>{{ $t(subItem.meta?.title as string, 2) }}</span>
99
</template>
1010
<SubItem :menuList="subItem.children" />
1111
</el-sub-menu>
@@ -15,7 +15,7 @@
1515
<SvgIcon :iconName="(subItem.meta?.icon as string)" />
1616
</el-icon>
1717
<template #title>
18-
<span>{{ $t(subItem.meta?.title as string) }}</span>
18+
<span>{{ $t(subItem.meta?.title as string, 2) }}</span>
1919
</template>
2020
</el-menu-item>
2121

@@ -24,8 +24,8 @@
2424
<SvgIcon :iconName="(subItem.meta?.icon as string)" />
2525
</el-icon>
2626
<template #title>
27-
<span v-if="subItem.meta?.icon">{{ $t(subItem.meta?.title as string) }}</span>
28-
<span v-else style="margin-left: 10px">{{ $t(subItem.meta?.title as string) }}</span>
27+
<span v-if="subItem.meta?.icon">{{ $t(subItem.meta?.title as string, 2) }}</span>
28+
<span v-else style="margin-left: 10px">{{ $t(subItem.meta?.title as string, 2) }}</span>
2929
</template>
3030
</el-menu-item>
3131
</template>

frontend/src/utils/util.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,17 +521,17 @@ export function getAge(d1: string): string {
521521

522522
let res = '';
523523
if (dayDiff > 0) {
524-
res += String(dayDiff) + ' ' + i18n.global.t('commons.units.day') + ' ';
524+
res += String(dayDiff) + ' ' + i18n.global.t('commons.units.day', dayDiff) + ' ';
525525
if (hours <= 0) {
526526
return res;
527527
}
528528
}
529529
if (hours > 0) {
530-
res += String(hours) + ' ' + i18n.global.t('commons.units.hour');
530+
res += String(hours) + ' ' + i18n.global.t('commons.units.hour', hours);
531531
return res;
532532
}
533533
if (minutes > 0) {
534-
res += String(minutes) + ' ' + i18n.global.t('commons.units.minute');
534+
res += String(minutes) + ' ' + i18n.global.t('commons.units.minute', minutes);
535535
return res;
536536
}
537537
return i18n.global.t('app.less1Minute');

frontend/src/views/app-store/apps/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<LayoutContent v-loading="loading" v-if="!showDetail" :title="$t('app.app')">
2+
<LayoutContent v-loading="loading" v-if="!showDetail" :title="$t('app.app', 2)">
33
<template #search>
44
<Tags @change="changeTag" />
55
</template>

frontend/src/views/app-store/installed/index.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,17 @@
228228
class="d-description flex flex-wrap items-center justify-start gap-1.5"
229229
>
230230
<el-button class="mr-1" plain size="small">
231-
{{ $t('app.version') }}:{{ installed.version }}
231+
{{ $t('app.version') }}{{ $t('commons.colon')
232+
}}{{ installed.version }}
232233
</el-button>
233234
<el-button
234235
v-if="installed.httpPort > 0"
235236
class="mr-1"
236237
plain
237238
size="small"
238239
>
239-
{{ $t('app.busPort') }}:{{ installed.httpPort }}
240+
{{ $t('app.busPort') }}{{ $t('commons.colon')
241+
}}{{ installed.httpPort }}
240242
</el-button>
241243
<el-button v-if="installed.httpsPort > 0" plain size="small">
242244
{{ $t('app.busPort') }}:{{ installed.httpsPort }}

0 commit comments

Comments
 (0)