@@ -25,7 +25,7 @@
{{range $i,$d := $service.Delay}}
+ data-tooltip="{{dayBefore $i}},{{tr "Availability"}}:{{float32f (div (index $service.Up $i) (add (index $service.Up $i) (index $service.Down $i)))}}%,{{tr "AverageLatency"}}:{{float32f $d}}ms">
{{end}}
|
@@ -39,20 +39,20 @@
{{if .CycleTransferStats}}
- 循环流量统计
+ {{tr "CycleTransferStats"}}
ID |
- 规则 |
- 服务器 |
- 自 |
- 至 |
+ {{tr "Rules"}} |
+ {{tr "Server"}} |
+ {{tr "From"}} |
+ {{tr "To"}} |
MAX |
MIN |
- 下次检查 |
- 当前用量 |
+ {{tr "NextCheck"}} |
+ {{tr "CurrentUsage"}} |
diff --git a/resource/template/theme-default/viewpassword.html b/resource/template/theme-default/viewpassword.html
index c78d78a..5199572 100644
--- a/resource/template/theme-default/viewpassword.html
+++ b/resource/template/theme-default/viewpassword.html
@@ -9,14 +9,14 @@
From 363b8909a1fdd8ee1173c14c664d7b59623f0637 Mon Sep 17 00:00:00 2001
From: Kris <“x@hi.sy”>
Date: Fri, 29 Apr 2022 15:59:39 +0200
Subject: [PATCH 2/3] Update all theme texts
---
resource/l10n/zh-CN.toml | 42 +++++++++++++++++++
resource/template/theme-daynight/home.html | 28 ++++++-------
resource/template/theme-daynight/service.html | 20 ++++-----
.../template/theme-daynight/viewpassword.html | 8 ++--
resource/template/theme-hotaru/home.html | 40 +++++++++---------
resource/template/theme-hotaru/service.html | 10 ++---
.../template/theme-hotaru/viewpassword.html | 4 +-
resource/template/theme-mdui/home.html | 26 ++++++------
resource/template/theme-mdui/menu.html | 22 +++++-----
resource/template/theme-mdui/service.html | 30 ++++++-------
.../template/theme-mdui/viewpassword.html | 8 ++--
11 files changed, 140 insertions(+), 98 deletions(-)
diff --git a/resource/l10n/zh-CN.toml b/resource/l10n/zh-CN.toml
index ac242f4..89fd671 100644
--- a/resource/l10n/zh-CN.toml
+++ b/resource/l10n/zh-CN.toml
@@ -417,3 +417,45 @@ other = "当前用量"
[VerifyPassword]
other = "验证查看密码"
+
+[LightMode]
+other = "白昼模式"
+
+[DarkMode]
+other = "暗黑模式"
+
+[GridLayout]
+other = "网格视图"
+
+[ListLayout]
+other = "列表视图"
+
+[EnterPassword]
+other = "输入密码"
+
+[StatusTips]
+other = """
+状态更新和事件报告可能会延迟最多30秒
+这取决于技术原因。请向下滚动查看过去的活动报告
+"""
+
+[Location]
+other = "地区"
+
+[Running]
+other = "运行中"
+
+[UpNetTransfer]
+other = "上行"
+
+[DownNetTransfer]
+other = "下行"
+
+[TotalUpNetTransfer]
+other = "总上行"
+
+[TotalDownNetTransfer]
+other = "总下行"
+
+[WrongPassword]
+other = "密码错误"
diff --git a/resource/template/theme-daynight/home.html b/resource/template/theme-daynight/home.html
index f0a7680..cb786f7 100644
--- a/resource/template/theme-daynight/home.html
+++ b/resource/template/theme-daynight/home.html
@@ -37,12 +37,12 @@
@@ -111,7 +111,7 @@
- 硬盘
+ {{tr "DiskUsed"}}
@@ -239,7 +239,7 @@
secondToDate(s) {
var d = Math.floor(s / 3600 / 24);
if (d > 0) {
- return d + "天"
+ return d + "{{tr "Day"}}"
}
var h = Math.floor(s / 3600 % 24);
var m = Math.floor(s / 60 % 60);
@@ -261,8 +261,8 @@
Swal.fire({
position: 'top',
icon: 'success',
- title: '实时通道建立',
- text: '可以实时获取最新监控数据啦',
+ title: '{{tr "RealtimeChannelEstablished"}}',
+ text: '{{tr "GetTheLatestMonitoringDataInRealTime"}}',
showConfirmButton: false,
timer: 2000
});
@@ -288,8 +288,8 @@
Swal.fire({
position: 'top',
icon: 'error',
- title: '实时通道断开',
- text: '无法实时获取最新监控数据咯',
+ title: '{{tr "RealtimeChannelDisconnect"}}',
+ text: '{{tr "CanNotGetTheLatestMonitoringDataInRealTime"}}',
showConfirmButton: false,
timer: 2000
});
diff --git a/resource/template/theme-daynight/service.html b/resource/template/theme-daynight/service.html
index 157566a..3661f5d 100644
--- a/resource/template/theme-daynight/service.html
+++ b/resource/template/theme-daynight/service.html
@@ -41,12 +41,12 @@
@@ -55,8 +55,8 @@
{{range $service := .Services}}
@@ -86,10 +86,10 @@
diff --git a/resource/template/theme-daynight/viewpassword.html b/resource/template/theme-daynight/viewpassword.html
index edc7c69..47f6870 100644
--- a/resource/template/theme-daynight/viewpassword.html
+++ b/resource/template/theme-daynight/viewpassword.html
@@ -17,13 +17,13 @@
- 登 录
+ {{tr "Login"}}
diff --git a/resource/template/theme-hotaru/home.html b/resource/template/theme-hotaru/home.html
index ca723e5..4ca5df2 100644
--- a/resource/template/theme-hotaru/home.html
+++ b/resource/template/theme-hotaru/home.html
@@ -33,7 +33,7 @@
- 狀態更新和事件報告可能會延遲最多30秒鐘 具體取決於手頭的技術問題。請向下滾動查看過去的事件報告
+ {{tr "StatusTips"}}
@@ -44,16 +44,16 @@
- 运行状态 |
- 节点名 |
- 系统 |
- 位置 |
- 在线 |
- 网络(B/s) ↓|↑ |
- 流量(B) ↓|↑ |
+ {{tr "Status"}} |
+ {{tr "Name"}} |
+ {{tr "Platform"}} |
+ {{tr "Location"}} |
+ {{tr "Uptime"}} |
+ {{tr "NetSpeed"}}(B/s) ↓|↑ |
+ {{tr "NetTransfer"}}(B) ↓|↑ |
CPU |
RAM |
- 硬盘 |
+ {{tr "DiskUsed"}} |
@@ -61,7 +61,7 @@
- @#server.live?'运行中':'已离线'#@
+ @#server.live?'{{tr "Running"}}':'{{tr "Offline"}}'#@
|
@@ -123,7 +123,7 @@
- - 网络:
+
- {{tr "NetSpeed"}}:
@#server.State?formatByteSize(server.State.NetInSpeed)+'/s|'+formatByteSize(server.State.NetOutSpeed)+'/s':'-'#@
@@ -135,15 +135,15 @@
@@ -224,7 +224,7 @@
secondToDate(s) {
var d = Math.floor(s / 3600 / 24);
if (d > 0) {
- return d + "天"
+ return d + "{{tr "Day"}}"
}
var h = Math.floor(s / 3600 % 24);
var m = Math.floor(s / 60 % 60);
@@ -251,8 +251,8 @@
const ws = new WebSocket(wsProtocol + '://' + window.location.host + '/ws');
ws.onopen = function (evt) {
$.suiAlert({
- title: '实时通道建立',
- description: '可以实时获取最新监控数据啦',
+ title: '{{tr "RealtimeChannelEstablished"}}',
+ description: '{{tr "GetTheLatestMonitoringDataInRealTime"}}',
type: 'success',
time: '2',
position: 'top-center',
@@ -276,8 +276,8 @@
}
ws.onclose = function () {
$.suiAlert({
- title: '实时通道断开',
- description: '无法实时获取最新监控数据咯',
+ title: '{{tr "RealtimeChannelDisconnect"}}',
+ description: '{{tr "CanNotGetTheLatestMonitoringDataInRealTime"}}',
type: 'warning',
time: '2',
position: 'top-center',
diff --git a/resource/template/theme-hotaru/service.html b/resource/template/theme-hotaru/service.html
index 854d0bf..608dd5b 100644
--- a/resource/template/theme-hotaru/service.html
+++ b/resource/template/theme-hotaru/service.html
@@ -11,10 +11,10 @@
- 名称 |
- 30天在线率 |
- 详情 |
- 状态 |
+ {{tr "Name"}} |
+ {{tr "30DaysOnline"}} |
+ {{tr "Details"}} |
+ {{tr "Status"}} |
@@ -26,7 +26,7 @@
{{range $i,$d := $service.Delay}}
+ data-tooltip="{{dayBefore $i}}, {{tr "AverageLatency"}}:{{float32f $d}}ms">
{{end}}
|
diff --git a/resource/template/theme-hotaru/viewpassword.html b/resource/template/theme-hotaru/viewpassword.html
index cc2b1fb..73b1b75 100644
--- a/resource/template/theme-hotaru/viewpassword.html
+++ b/resource/template/theme-hotaru/viewpassword.html
@@ -9,14 +9,14 @@
diff --git a/resource/template/theme-mdui/home.html b/resource/template/theme-mdui/home.html
index 01cfc8a..de63302 100644
--- a/resource/template/theme-mdui/home.html
+++ b/resource/template/theme-mdui/home.html
@@ -68,13 +68,13 @@
swap_vert
- 上行
+ {{tr "UpNetTransfer"}}
@#formatNetByteSize(server.State.NetOutSpeed)#@
- 下行
+ {{tr "DownNetTransfer"}}
@#formatNetByteSize(server.State.NetInSpeed)#@
@@ -83,13 +83,13 @@
swap_horiz
- 总上行
+ {{tr "TotalUpNetTransfer"}}
@#formatByteSize(server.State.NetOutTransfer)#@
- 总下行
+ {{tr "TotalDownNetTransfer"}}
@#formatByteSize(server.State.NetInTransfer)#@
@@ -107,14 +107,14 @@
ID |
- Name |
- Up |
- Down |
- Total Up |
- Total Down |
+ {{tr "Name"}} |
+ {{tr "UpNetTransfer"}} |
+ {{tr "DownNetTransfer"}} |
+ {{tr "TotalUpNetTransfer"}} |
+ {{tr "TotalDownNetTransfer"}} |
CPU |
RAM |
- Online |
+ {{tr "Uptime"}} |
@@ -178,7 +178,7 @@
secondToDate(s) {
var d = Math.floor(s / 3600 / 24);
if (d > 0) {
- return d + "天"
+ return d + "{{tr "Day"}}"
}
var h = Math.floor(s / 3600 % 24);
var m = Math.floor(s / 60 % 60);
@@ -229,7 +229,7 @@
const ws = new WebSocket(wsProtocol + '://' + window.location.host + '/ws');
ws.onopen = function (evt) {
mdui.snackbar({
- message: '实时通道建立',
+ message: '{{tr "RealtimeChannelEstablished"}}',
timeout: 2000,
position: 'top',
onClosed: function(){
@@ -281,7 +281,7 @@
}
ws.onclose = function () {
mdui.snackbar({
- message: '实时通道断开',
+ message: '{{tr "RealtimeChannelDisconnect"}}',
timeout: 2000,
position: 'top',
});
diff --git a/resource/template/theme-mdui/menu.html b/resource/template/theme-mdui/menu.html
index 7d0be88..ccbc461 100644
--- a/resource/template/theme-mdui/menu.html
+++ b/resource/template/theme-mdui/menu.html
@@ -4,25 +4,25 @@
diff --git a/resource/template/theme-mdui/service.html b/resource/template/theme-mdui/service.html
index 6732e5f..7044f93 100644
--- a/resource/template/theme-mdui/service.html
+++ b/resource/template/theme-mdui/service.html
@@ -26,10 +26,10 @@
- Name |
- SLA |
- Details of Last 30 Days |
- Now |
+ {{tr "Name"}} |
+ {{tr "Availability"}} |
+ {{tr "30DaysOnline"}} |
+ {{tr "Status"}} |
@@ -41,13 +41,13 @@
{{range $i,$d := $service.Delay}}
{{$percent := (div (index $service.Up $i) (add (index $service.Up $i) (index $service.Down $i)))}}
{{if eq $percent 0.0}}
- favorite_border
+ favorite_border
{{else if ge $percent 95.0}}
- favorite
+ favorite
{{else if ge $percent 80.0}}
- favorite
+ favorite
{{else}}
- favorite
+ favorite
{{end}}
{{end}}
@@ -74,20 +74,20 @@
{{if .CycleTransferStats}}
- Network Traffic Statistics
+ {{tr "CycleTransferStats"}}
ID |
- Rule |
- Sever |
- Date From |
- Date To |
+ {{tr "Rules"}} |
+ {{tr "Server"}} |
+ {{tr "From"}} |
+ {{tr "To"}} |
MAX |
MIN |
- Check Next |
- Usage |
+ {{tr "NextCheck"}} |
+ {{tr "CurrentUsage"}} |
diff --git a/resource/template/theme-mdui/viewpassword.html b/resource/template/theme-mdui/viewpassword.html
index 19a84f7..c8084ef 100644
--- a/resource/template/theme-mdui/viewpassword.html
+++ b/resource/template/theme-mdui/viewpassword.html
@@ -18,18 +18,18 @@
- 验证查看密码
+ {{tr "VerifyPassword"}}
-
+
@@ -52,7 +52,7 @@
window.location.href = res.url;
} else {
mdui.snackbar({
- message: '密码错误',
+ message: '{{tr "WrongPassword"}}',
position: 'top',
timeout: 2000,
});
From 68ecd36c9fad0c95cde99777a39d8732e4cb2758 Mon Sep 17 00:00:00 2001
From: naiba
Date: Fri, 29 Apr 2022 22:35:17 +0800
Subject: [PATCH 3/3] improve
---
resource/l10n/zh-CN.toml | 6 ------
resource/template/theme-daynight/home.html | 10 +++++-----
resource/template/theme-daynight/service.html | 8 ++++----
resource/template/theme-hotaru/home.html | 11 +++--------
4 files changed, 12 insertions(+), 23 deletions(-)
diff --git a/resource/l10n/zh-CN.toml b/resource/l10n/zh-CN.toml
index 89fd671..dd15fb0 100644
--- a/resource/l10n/zh-CN.toml
+++ b/resource/l10n/zh-CN.toml
@@ -433,12 +433,6 @@ other = "列表视图"
[EnterPassword]
other = "输入密码"
-[StatusTips]
-other = """
-状态更新和事件报告可能会延迟最多30秒
-这取决于技术原因。请向下滚动查看过去的活动报告
-"""
-
[Location]
other = "地区"
diff --git a/resource/template/theme-daynight/home.html b/resource/template/theme-daynight/home.html
index cb786f7..1d0ed21 100644
--- a/resource/template/theme-daynight/home.html
+++ b/resource/template/theme-daynight/home.html
@@ -42,7 +42,7 @@
{{if .Admin}}
{{tr "AdminPanel"}}
{{else}}
- {{tr Login}}
+ {{tr "Login"}}
{{end}}
@@ -133,10 +133,10 @@
diff --git a/resource/template/theme-daynight/service.html b/resource/template/theme-daynight/service.html
index 3661f5d..83a4470 100644
--- a/resource/template/theme-daynight/service.html
+++ b/resource/template/theme-daynight/service.html
@@ -86,10 +86,10 @@
diff --git a/resource/template/theme-hotaru/home.html b/resource/template/theme-hotaru/home.html
index 4ca5df2..c26242d 100644
--- a/resource/template/theme-hotaru/home.html
+++ b/resource/template/theme-hotaru/home.html
@@ -28,14 +28,9 @@
-
+
{{.Title}}
-
-
- {{tr "StatusTips"}}
-
-
@@ -135,8 +130,8 @@
| |