Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/check-locales.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const allLocales = [
["es", "es-ES"],
["de", "de-DE"],
["ru", "ru-RU"],
["zh", "zh-CN"],
];

const ignoreUnused = [
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/locale/IntlProvider.tsx
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { createIntl, createIntlCache } from "react-intl";
import langEn from "./lang/en.json";
import langDe from "./lang/de.json";
import langEn from "./lang/en.json";
import langEs from "./lang/es.json";
import langJa from "./lang/ja.json";
import langRu from "./lang/ru.json";
import langList from "./lang/lang-list.json";
import langRu from "./lang/ru.json";
import langZh from "./lang/zh.json";

// first item of each array should be the language code,
// not the country code
Expand All @@ -15,6 +16,7 @@ const localeOptions = [
["es", "es-ES"],
["ja", "ja-JP"],
["ru", "ru-RU"],
["zh", "zh-CN"],
];

const loadMessages = (locale?: string): typeof langList & typeof langEn => {
Expand All @@ -28,6 +30,8 @@ const loadMessages = (locale?: string): typeof langList & typeof langEn => {
return Object.assign({}, langList, langEn, langJa);
case "ru":
return Object.assign({}, langList, langEn, langRu);
case "zh":
return Object.assign({}, langList, langEn, langZh);
default:
return Object.assign({}, langList, langEn);
}
Expand All @@ -47,6 +51,9 @@ const getFlagCodeForLocale = (locale?: string) => {
case "ru-RU":
case "ru":
return "RU";
case "zh":
case "zh-CN":
return "CN";
default:
return "EN";
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/locale/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,4 @@
"user.switch-light": "Zum Light Mode wechslen",
"username": "Benutzername",
"users": "Benutzer"
}
}
3 changes: 2 additions & 1 deletion frontend/src/locale/lang/lang-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"locale-en-US": "English",
"locale-es-ES": "Español",
"locale-ja-JP": "日本語",
"locale-ru-RU": "Русский"
"locale-ru-RU": "Русский",
"locale-zh-CN": "中文"
}
216 changes: 216 additions & 0 deletions frontend/src/locale/lang/zh.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
{
"access-list": "通信规则",
"access-list.access-count": "{count} 条规则",
"access-list.auth-count": "{count} 个用户",
"access-list.help-rules-last": "当至少存在1条规则时,此拒绝所有规则将被添加到最后",
"access-list.help.rules-order": " 允许 (allow) 和禁止 (deny) 规则将按照它们定义的顺序执行。",
"access-list.pass-auth": "将认证传递给上游",
"access-list.public": "公开可访问",
"access-list.public.subtitle": "无需基本认证",
"access-list.satisfy-any": "满足任意条件",
"access-list.subtitle": "{users} 个用户, {rules} 条规则 - 创建时间: {date}",
"access-lists": "通信规则",
"action.add": "添加",
"action.add-location": "添加路径规则(Location)",
"action.close": "关闭",
"action.delete": "删除",
"action.disable": "禁用",
"action.download": "下载",
"action.edit": "编辑",
"action.enable": "启用",
"action.permissions": "权限",
"action.renew": "续期",
"action.view-details": "查看详情",
"auditlogs": "审计日志",
"cancel": "取消",
"certificate": "证书",
"certificate.custom-certificate": "证书",
"certificate.custom-certificate-key": "证书密钥",
"certificate.custom-intermediate": "中间证书",
"certificate.in-use": "使用中",
"certificate.none.subtitle": "未分配证书",
"certificate.none.subtitle.for-http": "此主机将不使用 HTTPS",
"certificate.none.title": "无",
"certificate.not-in-use": "未使用",
"certificate.renew": "续期证书",
"certificates": "证书列表",
"certificates.custom": "自定义证书",
"certificates.custom.warning": "不支持受密码保护的密钥文件。",
"certificates.dns.credentials": "凭据文件内容",
"certificates.dns.credentials-note": "此插件需要一个包含 API 令牌或提供商其他凭证的配置文件",
"certificates.dns.credentials-warning": "此数据将以明文形式存储在数据库和文件中!",
"certificates.dns.propagation-seconds": "传播时间 (秒)",
"certificates.dns.propagation-seconds-note": "留空以使用插件默认值。等待DNS传播的秒数。",
"certificates.dns.provider": "DNS 提供商",
"certificates.dns.warning": "本节需要您具备一些关于 Certbot 及其 DNS 插件的知识,请参阅相应插件的官方文档。",
"certificates.http.reachability-404": "在此域名下找到了一个服务器,但它似乎不是 Nginx 代理管理器。请确保您的域名指向 NPM 实例运行的 IP 地址。",
"certificates.http.reachability-failed-to-check": "由于与site24x7.com通信错误,无法检查可达性。",
"certificates.http.reachability-not-resolved": "此域名下没有可用的服务器。请确保您的域名存在并指向NPM实例运行的 IP 地址,如有必要,请在路由器中转发 80 端口。",
"certificates.http.reachability-ok": "您的服务器可以访问,应该可以创建证书。",
"certificates.http.reachability-other": "在此域名下找到了一个服务器,但它返回了意外的状态码 {code}。它是 NPM 服务器吗?请确保您的域名指向NPM实例运行的 IP 地址。",
"certificates.http.reachability-wrong-data": "在此域名下找到了一个服务器,但它返回了意外的数据。它是 NPM 服务器吗?请确保您的域名指向 NPM 实例运行的 IP 地址。",
"certificates.http.test-results": "测试结果",
"certificates.http.warning": "这些域名必须配置为指向本设备。",
"certificates.request.subtitle": "使用 Let's Encrypt",
"certificates.request.title": "申请新证书",
"column.access": "访问",
"column.authorization": "授权",
"column.authorizations": "授权列表",
"column.custom-locations": "自定义路径规则 (Locations)",
"column.destination": "目标",
"column.details": "详情",
"column.email": "邮箱",
"column.event": "事件",
"column.expires": "过期时间",
"column.http-code": "访问",
"column.incoming-port": "入站端口",
"column.name": "名称",
"column.protocol": "协议",
"column.provider": "提供商",
"column.roles": "角色",
"column.rules": "规则",
"column.satisfy": "满足",
"column.satisfy-all": "全部",
"column.satisfy-any": "任意",
"column.scheme": "协议",
"column.source": "来源",
"column.ssl": "SSL",
"column.status": "状态",
"created-on": "创建时间: {date}",
"dashboard": "仪表板",
"dead-host": "错误页面",
"dead-hosts": "错误页面列表",
"dead-hosts.count": "{count} 个错误页面列表",
"disabled": "已禁用",
"domain-names": "域名",
"domain-names.max": "{count} 个最多域名数量",
"domain-names.placeholder": "开始输入以添加域名...",
"domain-names.wildcards-not-permitted": "此类型不允许使用通配符",
"domain-names.wildcards-not-supported": "此 CA 不支持通配符",
"domains.force-ssl": "强制 SSL",
"domains.hsts-enabled": "HSTS 已启用",
"domains.hsts-subdomains": "HSTS 子域名",
"domains.http2-support": "HTTP/2 支持",
"domains.use-dns": "使用DNS验证",
"email-address": "邮箱地址",
"empty-search": "未找到结果",
"empty-subtitle": "为什么不由您来创建一个呢?",
"enabled": "已启用",
"error.access.at-least-one": "需要至少一个授权或访问规则",
"error.access.duplicate-usernames": "授权用户名必须唯一",
"error.invalid-auth": "无效的邮箱或密码",
"error.invalid-domain": "无效的域名: {domain}",
"error.invalid-email": "无效的邮箱地址",
"error.max-character-length": "最大长度为 {max} 个字符",
"error.max-domains": "域名过多,最多为 {max} 个",
"error.maximum": "最大值为 {max}",
"error.min-character-length": "最小长度为 {min} 个字符",
"error.minimum": "最小值为 {min}",
"error.passwords-must-match": "密码必须匹配",
"error.required": "此项为必填项",
"expires.on": "过期时间: {date}",
"footer.github-fork": "在 Github 上复刻 (For) 本项目",
"host.flags.block-exploits": "阻止常见攻击",
"host.flags.cache-assets": "缓存资源",
"host.flags.preserve-path": "保留路径",
"host.flags.protocols": "协议",
"host.flags.websockets-upgrade": "Websockets 支持",
"host.forward-port": "转发端口",
"host.forward-scheme": "协议",
"hosts": "主机列表",
"http-only": "仅 HTTP",
"lets-encrypt": "Let's Encrypt",
"lets-encrypt-via-dns": "Let's Encrypt DNS 验证",
"lets-encrypt-via-http": "Let's Encrypt HTTP 验证",
"loading": "加载中···",
"login.title": "登录您的账户",
"nginx-config.label": "自定义 Nginx 配置",
"nginx-config.placeholder": "# 在此输入您的自定义 Nginx 配置,风险自负!",
"no-permission-error": "您无权查看此内容。",
"notfound.action": "返回首页",
"notfound.content": "很抱歉,您要查找的页面未找到",
"notfound.title": "糟糕...您刚刚找到了一个错误页面",
"notification.error": "错误",
"notification.object-deleted": "{object} 已被删除",
"notification.object-disabled": "{object} 已被禁用",
"notification.object-enabled": "{object} 已被启用",
"notification.object-renewed": "{object} 已续期",
"notification.object-saved": "{object} 已保存",
"notification.success": "成功",
"object.actions-title": "{object} #{id}",
"object.add": "添加 {object}",
"object.delete": "删除 {object}",
"object.delete.content": "您确定要删除 {object} 吗?",
"object.edit": "编辑 {object}",
"object.empty": "没有 {objects}",
"object.event.created": "已创建 {object}",
"object.event.deleted": "已删除 {object}",
"object.event.disabled": "已禁用 {object}",
"object.event.enabled": "已启用 {object}",
"object.event.renewed": "已续期 {object}",
"object.event.updated": "已更新 {object}",
"offline": "离线",
"online": "在线",
"options": "选项",
"password": "密码",
"password.generate": "生成随机密码",
"password.hide": "隐藏密码",
"password.show": "显示密码",
"permissions.hidden": "隐藏",
"permissions.manage": "管理",
"permissions.view": "仅查看",
"permissions.visibility.all": "所有项目",
"permissions.visibility.title": "项目可见性",
"permissions.visibility.user": "仅创建的项目",
"proxy-host": "代理服务",
"proxy-host.forward-host": "转发主机名 / IP",
"proxy-hosts": "代理服务列表",
"proxy-hosts.count": "{count} 个代理服务",
"public": "公开",
"redirection-host": "重定向主机",
"redirection-host.forward-domain": "转发域名",
"redirection-host.forward-http-code": "HTTP 状态码",
"redirection-hosts": "重定向主机列表",
"redirection-hosts.count": "{count} 个重定向主机",
"role.admin": "管理员",
"role.standard-user": "标准用户",
"save": "保存",
"setting": "设置",
"settings": "设置列表",
"settings.default-site": "默认站点",
"settings.default-site.404": "错误页面",
"settings.default-site.444": "无响应 (444)",
"settings.default-site.congratulations": "欢迎页面",
"settings.default-site.description": "当 Nginx 遇到未知主机时显示什么",
"settings.default-site.html": "自定义 HTML",
"settings.default-site.html.placeholder": "<!-- 在此输入您的自定义 HTML 内容 -->",
"settings.default-site.redirect": "重定向",
"setup.preamble": "通过创建您的管理员账户开始使用。",
"setup.title": "欢迎!",
"sign-in": "登录",
"ssl-certificate": "SSL 证书",
"stream": "端口转发",
"stream.forward-host": "转发主机",
"stream.incoming-port": "入站端口",
"streams": "端口转发列表",
"streams.count": "{count} 个端口转发",
"streams.tcp": "TCP",
"streams.udp": "UDP",
"test": "测试",
"user": "用户",
"user.change-password": "修改密码",
"user.confirm-password": "确认密码",
"user.current-password": "当前密码",
"user.edit-profile": "编辑资料",
"user.full-name": "全名",
"user.login-as": "登录用户 {name}",
"user.logout": "退出登录",
"user.new-password": "新密码",
"user.nickname": "昵称",
"user.set-password": "设置密码",
"user.set-permissions": "为用户 {name} 设置权限",
"user.switch-dark": "切换到深色模式",
"user.switch-light": "切换到浅色模式",
"username": "用户名",
"users": "用户列表"
}
3 changes: 2 additions & 1 deletion frontend/src/locale/src/HelpDoc/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as de from "./de/index";
import * as en from "./en/index";
import * as ja from "./ja/index";
import * as zh from "./zh/index";

const items: any = { en, de, ja };
const items: any = { en, de, ja, zh };

const fallbackLang = "en";

Expand Down
7 changes: 7 additions & 0 deletions frontend/src/locale/src/HelpDoc/zh/AccessLists.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 什么是通信规则?

通信规则提供了一个特定客户IP地址的黑名单或白名单,以及通过基本HTTP认证对代理服务的认证。

你可以为一个通信规则配置多个客户规则、用户名和密码,然后将其应用于代理服务。

这对那些没有内置认证机制的转发网络服务或你想保护其免受未知客户的访问是最有用的。
21 changes: 21 additions & 0 deletions frontend/src/locale/src/HelpDoc/zh/Certificates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## 证书帮助

### HTTP 证书

HTTP 验证的证书表示 Let's Encrypt 服务器将尝试通过 HTTP(而非 HTTPS!)访问您的域名,如果成功,它们将为您颁发证书。

使用此方法时,您必须为您的域名创建一个可通过 HTTP 访问并指向此 Nginx 安装的 代理主机。在获得证书后,您可以修改该 代理主机,使其也使用此证书处理 HTTPS 连接。然而,为了证书能够续期,该 代理主机 仍需配置为支持 HTTP 访问。

此过程_不支持_通配符域名。

### DNS 证书

DNS 验证的证书要求您使用一个 DNS 服务商插件。该 DNS 服务商将用于在您的域名下创建临时记录,随后 Let's Encrypt 将查询这些记录以确认您是域名所有者,如果成功,它们将为您颁发证书。

请求此类证书前,您无需预先创建 代理主机,也无需将您的 代理主机 配置为支持 HTTP 访问。

此过程_支持_通配符域名。

### 自定义证书

使用此选项上传您自己的 SSL 证书,该证书由您自己的证书颁发机构提供。
7 changes: 7 additions & 0 deletions frontend/src/locale/src/HelpDoc/zh/DeadHosts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 什么是错误页面?

错误页面是一个简单的主机设置,显示错误页面。

当你的域名被列入搜索引擎,而你想提供一个更好的错误页面或特别是告诉搜索索引者域名页面不再存在时,这可能是有用的。

拥有这种主机的另一个好处是可以跟踪点击它的日志并查看访问来源。
7 changes: 7 additions & 0 deletions frontend/src/locale/src/HelpDoc/zh/ProxyHosts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 什么是代理服务?

代理服务是你想转发网络应用的主机。

代理服务可以为没有SSL服务的网络应用提供SSL服务(可选)。

代理服务是Nginx代理管理器的最常见用途之一。
5 changes: 5 additions & 0 deletions frontend/src/locale/src/HelpDoc/zh/RedirectionHosts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 什么是重定向?

重定向是将接入域名的请求推送到另一个域名。

使用这种类型的主机最常见的原因是当你的网站改变了域名,但你仍然有链接指向旧域名的应用。
5 changes: 5 additions & 0 deletions frontend/src/locale/src/HelpDoc/zh/Streams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 什么是端口转发?

端口转发是Nginx的一个相对较新的功能,可以直接转发 TCP/UDP 流量到网络上的另一台计算机。

如果你正在运行游戏服务器、FTP或SSH服务器,这个功能就会很有用。
6 changes: 6 additions & 0 deletions frontend/src/locale/src/HelpDoc/zh/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export * as AccessLists from "./AccessLists.md";
export * as Certificates from "./Certificates.md";
export * as DeadHosts from "./DeadHosts.md";
export * as ProxyHosts from "./ProxyHosts.md";
export * as RedirectionHosts from "./RedirectionHosts.md";
export * as Streams from "./Streams.md";
3 changes: 3 additions & 0 deletions frontend/src/locale/src/lang-list.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
},
"locale-ru-RU": {
"defaultMessage": "Русский"
},
"locale-zh-CN": {
"defaultMessage": "中文"
}
}
Loading