🌐 dashboard v0.13.1 improve localization

This commit is contained in:
naiba
2022-04-30 09:32:57 +08:00
parent 9eb50a5b9d
commit 833519e974
25 changed files with 305 additions and 237 deletions

View File

@@ -1,4 +1,4 @@
[nezhaMonitor]
[NezhaMonitoring]
other = "Nezha Monitoring"
[Server]
@@ -76,7 +76,7 @@ other = "Specific Servers"
[EnterIdAndNameToSearch]
other = "Input Server ID/Name to search"
[NotificationMethod]
[NotificationMethodGroup]
other = "Notification Group"
[PushSuccessMessages]
@@ -250,9 +250,6 @@ other = "One Key Install"
[ClickToCopyTheInstallationCommand]
other = "Click To Copy Install Command"
[NotSupportedYet]
other = "Not supported yet, check the release page for manual install"
[DeleteServer]
other = "Delete Server"
@@ -453,3 +450,42 @@ other = "Total Inbound"
[WrongPassword]
other = "Incorrect Password"
[AnErrorEccurred]
other = "An error occurred"
[SystemError]
other = "System Error"
[NetowrkError]
other = "Netowrk Error"
[ServicesStatus]
other = "Services Status"
[ServersManagement]
other = "Servers"
[ServicesManagement]
other = "Services"
[ScheduledTasks]
other = "Scheduled Tasks"
[YouAreNotAuthorized]
other = "You are not authorized"
[WrongAccessPassword]
other = "Wrong access password"
[Add]
other = "Add"
[Edit]
other = "Edit"
[AlarmRule]
other = "Alarm Rule"
[NotificationMethod]
other = "Notification Method"

View File

@@ -1,4 +1,4 @@
[nezhaMonitor]
[NezhaMonitoring]
other = "哪吒监控"
[Server]
@@ -76,7 +76,7 @@ other = "特定服务器"
[EnterIdAndNameToSearch]
other = "输入ID/名称以搜索"
[NotificationMethod]
[NotificationMethodGroup]
other = "通知方式组"
[PushSuccessMessages]
@@ -250,9 +250,6 @@ other = "一键安装"
[ClickToCopyTheInstallationCommand]
other = "点击复制安装命令"
[NotSupportedYet]
other = "尚未支持请下载release手动安装"
[DeleteServer]
other = "删除主机"
@@ -453,3 +450,42 @@ other = "总下行"
[WrongPassword]
other = "密码错误"
[AnErrorEccurred]
other = "出现错误"
[SystemError]
other = "系统错误"
[NetowrkError]
other = "网络错误"
[ServicesStatus]
other = "服务状态"
[ServersManagement]
other = "服务器管理"
[ServicesManagement]
other = "服务监控"
[ScheduledTasks]
other = "计划任务"
[YouAreNotAuthorized]
other = "此页面需要登录"
[WrongAccessPassword]
other = "查看密码错误"
[Add]
other = "添加"
[Edit]
other = "修改"
[AlarmRule]
other = "报警规则"
[NotificationMethod]
other = "通知方式"

View File

@@ -1,3 +1,19 @@
let LANG = {
Add: "添加",
Edit: "修改",
AlarmRule: "报警规则",
Notification: "通知方式",
Server: "服务器",
Monitor: "监控",
Cron: "计划任务",
}
function updateLang(newLang) {
if (newLang) {
LANG = newLang;
}
}
function readableBytes(bytes) {
if (!bytes) {
return '0B'
@@ -105,11 +121,11 @@ function showFormModal(modelSelector, formID, URL, getData) {
function addOrEditAlertRule(rule) {
const modal = $(".rule.modal");
modal.children(".header").text((rule ? "修改" : "添加") + "报警规则");
modal.children(".header").text((rule ? LANG.Edit : LANG.Add) + ' ' + LANG.AlarmRule);
modal
.find(".nezha-primary-btn.button")
.html(
rule ? '修改<i class="edit icon"></i>' : '添加<i class="add icon"></i>'
rule ? LANG.Edit + '<i class="edit icon"></i>' : LANG.Add + '<i class="add icon"></i>'
);
modal.find("input[name=ID]").val(rule ? rule.ID : null);
modal.find("input[name=Name]").val(rule ? rule.Name : null);
@@ -125,13 +141,13 @@ function addOrEditAlertRule(rule) {
function addOrEditNotification(notification) {
const modal = $(".notification.modal");
modal.children(".header").text((notification ? "修改" : "添加") + "通知方式");
modal.children(".header").text((notification ? LANG.Edit : LANG.Add) + ' ' + LANG.Notification);
modal
.find(".nezha-primary-btn.button")
.html(
notification
? '修改<i class="edit icon"></i>'
: '添加<i class="add icon"></i>'
? LANG.Edit + '<i class="edit icon"></i>'
: LANG.Add + '<i class="add icon"></i>'
);
modal.find("input[name=ID]").val(notification ? notification.ID : null);
modal.find("input[name=Name]").val(notification ? notification.Name : null);
@@ -188,11 +204,11 @@ function post(path, params, method = 'post') {
function addOrEditServer(server, conf) {
const modal = $(".server.modal");
modal.children(".header").text((server ? "修改" : "添加") + "服务器");
modal.children(".header").text((server ? LANG.Edit : LANG.Add) + ' ' + LANG.Server);
modal
.find(".nezha-primary-btn.button")
.html(
server ? '修改<i class="edit icon"></i>' : '添加<i class="add icon"></i>'
server ? LANG.Edit + '<i class="edit icon"></i>' : LANG.Add + '<i class="add icon"></i>'
);
modal.find("input[name=id]").val(server ? server.ID : null);
modal.find("input[name=name]").val(server ? server.Name : null);
@@ -216,11 +232,11 @@ function addOrEditServer(server, conf) {
function addOrEditMonitor(monitor) {
const modal = $(".monitor.modal");
modal.children(".header").text((monitor ? "修改" : "添加") + "监控");
modal.children(".header").text((monitor ? LANG.Edit : LANG.Add) + ' ' + LANG.Monitor);
modal
.find(".nezha-primary-btn.button")
.html(
monitor ? '修改<i class="edit icon"></i>' : '添加<i class="add icon"></i>'
monitor ? LANG.Edit + '<i class="edit icon"></i>' : LANG.Add + '<i class="add icon"></i>'
);
modal.find("input[name=ID]").val(monitor ? monitor.ID : null);
modal.find("input[name=Name]").val(monitor ? monitor.Name : null);
@@ -257,11 +273,11 @@ function addOrEditMonitor(monitor) {
function addOrEditCron(cron) {
const modal = $(".cron.modal");
modal.children(".header").text((cron ? "修改" : "添加") + "计划任务");
modal.children(".header").text((cron ? LANG.Edit : LANG.Add) + ' ' + LANG.Cron);
modal
.find(".nezha-primary-btn.button")
.html(
cron ? '修改<i class="edit icon"></i>' : '添加<i class="add icon"></i>'
cron ? LANG.Edit + '<i class="edit icon"></i>' : LANG.Add + '<i class="add icon"></i>'
);
modal.find("input[name=ID]").val(cron ? cron.ID : null);
modal.find("input[name=Name]").val(cron ? cron.Name : null);

View File

@@ -1,16 +1,22 @@
{{define "common/footer"}}
<div class="ui inverted vertical footer segment">
<div class="ui center aligned is-size-7 container">
<b>&copy; <a style="color: white;" href="/">{{.Conf.Site.Brand}}</a></b> | <small>Powered by <a href="https://github.com/naiba/nezha"
style="color: white;" target="_blank">{{tr "nezhaMonitor"}}</a> {{.Version}}</small>
<b>&copy; <a style="color: white;" href="/">{{.Conf.Site.Brand}}</a></b> | <small>Powered by <a
href="https://github.com/naiba/nezha" style="color: white;" target="_blank">{{tr "NezhaMonitoring"}}</a>
{{.Version}}</small>
</div>
</div>
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.4.1/jquery.min.js"></script>
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/semantic-ui/2.4.1/semantic.min.js"></script>
<script src="/static/semantic-ui-alerts.min.js"></script>
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.12/vue.min.js"></script>
<script src="/static/main.js?v20220423"></script>
<script src="/static/main.js?v20220430"></script>
<script>
(function () {
updateLang({{.LANG }});
})();
</script>
</body>
</html>
{{end}}
{{end}}

View File

@@ -33,7 +33,7 @@
</div>
</div>
<div class="field">
<label>{{tr "NotificationMethod"}}}</label>
<label>{{tr "NotificationMethodGroup"}}}</label>
<input type="text" name="NotificationTag" placeholder="default">
</div>
<div class="field">

View File

@@ -45,7 +45,7 @@
</div>
</div>
<div class="field">
<label>{{tr "NotificationMethod"}}</label>
<label>{{tr "NotificationMethodGroup"}}</label>
<input type="text" name="NotificationTag" placeholder="default" />
</div>
<div class="field">

View File

@@ -13,7 +13,7 @@
<textarea name="RulesRaw"></textarea>
</div>
<div class="field">
<label>{{tr "NotificationMethod"}}</label>
<label>{{tr "NotificationMethodGroup"}}</label>
<input type="text" name="NotificationTag" placeholder="default">
</div>
<div class="field">

View File

@@ -17,7 +17,7 @@
<th>{{tr "Name"}}</th>
<th>{{tr "Scheduler"}}</th>
<th>{{tr "Command"}}</th>
<th>{{tr "NotificationMethod"}}</th>
<th>{{tr "NotificationMethodGroup"}}</th>
<th>{{tr "PushSuccessfully"}}</th>
<th>{{tr "Coverage"}}</th>
<th>{{tr "SpecificServers"}}</th>

View File

@@ -19,7 +19,7 @@
<th>{{tr "SpecificServers"}}</th>
<th>{{tr "Type"}}</th>
<th>{{tr "Duration"}}</th>
<th>{{tr "NotificationMethod"}}</th>
<th>{{tr "NotificationMethodGroup"}}</th>
<th>{{tr "Notification"}}</th>
<th>{{tr "Administration"}}</th>
</tr>

View File

@@ -57,7 +57,7 @@
<tr>
<th>ID</th>
<th>{{tr "Name"}}</th>
<th>{{tr "NotificationMethod"}}</th>
<th>{{tr "NotificationMethodGroup"}}</th>
<th>{{tr "Rules"}}</th>
<th>{{tr "Enable"}}</th>
<th>{{tr "Administration"}}</th>

View File

@@ -44,15 +44,11 @@
data-tooltip="{{tr "ClickToCopyTheInstallationCommand"}}">
<i class="linux icon"></i>
</button>
<button class="ui icon mini button" data-tooltip="{{tr "NotSupportedYet"}}">
<button class="ui icon green mini button"
data-clipboard-text="{{if $.Conf.GRPCHost}}set-ExecutionPolicy RemoteSigned;Invoke-WebRequest https://raw.githubusercontent.com/naiba/nezha/master/script/install.ps1 -OutFile C:\install.ps1;powershell.exe C:\install.ps1 {{$.Conf.GRPCHost}}:{{if $.Conf.ProxyGRPCPort}}{{$.Conf.ProxyGRPCPort}}{{else}}{{$.Conf.GRPCPort}}{{end}} {{$server.Secret}}{{if $.Conf.TLS}} --tls{{end}}{{else}}{{tr "NoDomainAlert"}}{{end}}"
data-tooltip="{{tr "ClickToCopyTheInstallationCommand"}}">
<i class="windows icon"></i>
</button>
<button class="ui icon mini button" data-tooltip="{{tr "NotSupportedYet"}}">
<i class="apple icon"></i>
</button>
</td>
<td style="word-break: break-word;">{{$server.Note}}</td>
<td>

View File

@@ -6,7 +6,7 @@
<form id="settingForm" class="ui large form" onsubmit="return false;">
<div class="field">
<label>{{tr "SiteTitle"}}</label>
<input type="text" name="Title" placeholder="{{tr "nezhaMonitor"}}" value="{{.Conf.Site.Brand}}">
<input type="text" name="Title" placeholder="{{tr "NezhaMonitoring"}}" value="{{.Conf.Site.Brand}}">
</div>
<div class="field">
<label>{{tr "AdministratorList"}}</label>

View File

@@ -23,7 +23,7 @@
<section class="nav-bar clearfix">
<figure class="logo">
<a href="/">
<img src="/static/logo.svg?v20210804" alt='{{tr "nezhaMonitor"}}' width="50" height="50">
<img src="/static/logo.svg?v20210804" alt='{{tr "NezhaMonitoring"}}' width="50" height="50">
</a>
<a href="/">{{.Conf.Site.Brand}}</a>
</figure>
@@ -155,7 +155,7 @@
<footer>
<div class="footer-container">
<div><a href="https://github.com/naiba/nezha" target="_blank">Powered by {{tr "nezhaMonitor"}} · {{.Version}}</a>
<div><a href="https://github.com/naiba/nezha" target="_blank">Powered by {{tr "NezhaMonitoring"}} · {{.Version}}</a>
<p>&copy; <span id="copyright-date">
<script>document.getElementById('copyright-date').appendChild(document.createTextNode(new Date().getFullYear()))</script>
</span> · <a href="https://blog.jackiesung.com" target="_blank">Theme designed by Jackie Sung</a>

View File

@@ -118,7 +118,7 @@
<footer>
<div class="footer-container">
<div>
<a href="https://github.com/naiba/nezha" target="_blank">Powered by {{tr "nezhaMonitor"}} · {{.Version}}</a>
<a href="https://github.com/naiba/nezha" target="_blank">Powered by {{tr "NezhaMonitoring"}} · {{.Version}}</a>
<p>
&copy;
<span id="copyright-date"

View File

@@ -42,7 +42,7 @@
<footer>
<div class="footer-container">
<div>
<a href="https://github.com/naiba/nezha" target="_blank">Powered by {{tr "nezhaMonitor"}} · {{.Version}}</a>
<a href="https://github.com/naiba/nezha" target="_blank">Powered by {{tr "NezhaMonitoring"}} · {{.Version}}</a>
<p>
&copy;<span id="copyright-date"
><script>

View File

@@ -135,7 +135,7 @@
</ul>
</div>
<footer>
<p style="text-align:center;padding: 15px;">Powered by <a href="https://github.com/naiba/nezha">{{tr "nezhaMonitor"}}</a> build ·
<p style="text-align:center;padding: 15px;">Powered by <a href="https://github.com/naiba/nezha">{{tr "NezhaMonitoring"}}</a> build ·
{{.Version}}
<a href="/service">{{tr "Services"}}</a>
<a href="/server">{{tr "AdminPanel"}}</a>

View File

@@ -5,7 +5,7 @@
<center>
<p>
<a href="/"><at>{{.Title}}</at></a>
Powered by <a href="https://github.com/naiba/nezha"><st>{{tr "nezhaMonitor"}}&lt;{{.Version}}&gt;</st></a>&nbsp;| Theme designed by Mikoy Chinese
Powered by <a href="https://github.com/naiba/nezha"><st>{{tr "NezhaMonitoring"}}&lt;{{.Version}}&gt;</st></a>&nbsp;| Theme designed by Mikoy Chinese
</p>
</center>
</div>