Browse Source

feat(i18n): Add Chinese language support and related translation files

pull/1730/head
Anyexyz 4 weeks ago
parent
commit
6d8a679677
  1. 2
      src/i18n/i18n.config.ts
  2. 223
      src/i18n/locales/zh_cn.json
  3. 5
      src/nuxt.config.ts

2
src/i18n/i18n.config.ts

@ -1,9 +1,11 @@
import en from './locales/en.json';
import zh_cn from './locales/zh_cn.json';
export default defineI18nConfig(() => ({
legacy: false,
fallbackLocale: 'en',
messages: {
en,
'zh-CN': zh_cn,
},
}));

223
src/i18n/locales/zh_cn.json

@ -0,0 +1,223 @@
{
"pages": {
"me": "账户",
"clients": "客户端",
"admin": {
"panel": "管理面板",
"general": "常规",
"config": "配置",
"interface": "接口",
"hooks": "钩子"
}
},
"user": {
"email": "电子邮箱"
},
"me": {
"currentPassword": "当前密码"
},
"general": {
"name": "名称",
"username": "用户名",
"password": "密码",
"newPassword": "新密码",
"updatePassword": "更新密码",
"mtu": "MTU",
"allowedIps": "允许的IP",
"dns": "DNS",
"persistentKeepalive": "持久保持活动",
"logout": "退出登录",
"continue": "继续",
"host": "主机",
"port": "端口",
"yes": "是",
"no": "否",
"confirmPassword": "确认密码"
},
"setup": {
"welcome": "欢迎首次设置wg-easy!",
"welcomeDesc": "您已找到在任意Linux主机上安装和管理WireGuard的最简方式!",
"existingSetup": "您已有现有设置吗?",
"createAdminDesc": "请先输入管理员用户名和强密码。此信息将用于登录管理面板。",
"setupConfigDesc": "请输入主机和端口信息。这将用于客户端配置其设备上的WireGuard。",
"setupMigrationDesc": "如果您希望将数据从旧版wg-easy迁移至新环境,请提供备份文件。",
"upload": "上传",
"migration": "恢复备份",
"createAccount": "创建账户",
"successful": "设置成功"
},
"update": {
"updateAvailable": "有可用更新!",
"update": "更新"
},
"theme": {
"dark": "深色主题",
"light": "浅色主题",
"system": "系统主题"
},
"layout": {
"toggleCharts": "显示/隐藏图表",
"donate": "捐赠"
},
"login": {
"signIn": "登录",
"rememberMe": "记住我",
"rememberMeDesc": "关闭浏览器后保持登录状态"
},
"error": {
"clear": "清空",
"login": "登录错误"
},
"client": {
"empty": "暂无客户端。",
"newShort": "新建",
"sort": "排序",
"create": "创建客户端",
"created": "客户端已创建",
"new": "新建客户端",
"name": "名称",
"expireDate": "过期日期",
"expireDateDesc": "客户端将被停用的日期。留空表示永久有效",
"deleteClient": "删除客户端",
"deleteDialog1": "确定要删除",
"deleteDialog2": "此操作不可撤销。",
"enabled": "已启用",
"address": "地址",
"serverAllowedIps": "服务器允许的IP",
"otlDesc": "生成一次性短链接",
"permanent": "永久",
"createdOn": "创建于 ",
"lastSeen": "最后活跃于 ",
"totalDownload": "总下载:",
"totalUpload": "总上传:",
"newClient": "新建客户端",
"disableClient": "停用客户端",
"enableClient": "启用客户端",
"noPrivKey": "此客户端无已知私钥,无法创建配置。",
"showQR": "显示二维码",
"downloadConfig": "下载配置",
"allowedIpsDesc": "将通过VPN路由的IP(覆盖全局配置)",
"serverAllowedIpsDesc": "服务器将路由至客户端的IP",
"mtuDesc": "设置VPN隧道的最大传输单元(数据包大小)",
"persistentKeepaliveDesc": "设置保活包发送间隔(秒)。0表示禁用",
"hooks": "钩子",
"hooksDescription": "钩子仅适用于wg-quick",
"hooksLeaveEmpty": "仅适用于wg-quick,否则请留空",
"dnsDesc": "客户端使用的DNS服务器(覆盖全局配置)"
},
"dialog": {
"change": "修改",
"cancel": "取消",
"create": "创建"
},
"toast": {
"success": "成功",
"saved": "已保存",
"error": "错误",
"errored": "保存失败"
},
"form": {
"actions": "操作",
"save": "保存",
"revert": "还原",
"sectionGeneral": "常规",
"sectionAdvanced": "高级",
"noItems": "无项目",
"nullNoItems": "无项目,使用全局配置",
"add": "添加"
},
"admin": {
"general": {
"sessionTimeout": "会话超时",
"sessionTimeoutDesc": "记住我功能的会话持续时间(秒)",
"metrics": "指标",
"metricsPassword": "密码",
"metricsPasswordDesc": "指标端点的Bearer密码(argon2哈希)",
"json": "JSON",
"jsonDesc": "JSON格式指标路由",
"prometheus": "Prometheus",
"prometheusDesc": "Prometheus指标路由"
},
"config": {
"connection": "连接",
"hostDesc": "客户端连接的公共主机名(会使配置失效)",
"portDesc": "客户端连接的公共UDP端口(会使配置失效)",
"allowedIpsDesc": "客户端使用的全局允许IP",
"dnsDesc": "客户端使用的全局DNS服务器",
"mtuDesc": "客户端使用的MTU(仅对新客户端生效)",
"persistentKeepaliveDesc": "向服务器发送保活包的间隔(秒)。0=禁用(仅对新客户端生效)"
},
"interface": {
"cidrSuccess": "CIDR已修改",
"cidrError": "CIDR修改失败",
"device": "设备",
"deviceDesc": "WireGuard流量应转发的以太网设备",
"mtuDesc": "WireGuard使用的MTU",
"portDesc": "WireGuard监听的UDP端口(可能使配置失效)",
"changeCidr": "修改CIDR"
}
},
"zod": {
"generic": {
"required": "{0}是必填项",
"validNumber": "{0}必须是有效数字",
"validString": "{0}必须是有效字符串",
"validBoolean": "{0}必须是有效布尔值",
"validArray": "{0}必须是有效数组",
"stringMin": "{0}至少需要{1}个字符",
"numberMin": "{0}必须至少为{1}"
},
"client": {
"id": "客户端ID",
"name": "名称",
"expiresAt": "过期时间",
"address4": "IPv4地址",
"address6": "IPv6地址",
"serverAllowedIps": "服务器允许的IP"
},
"user": {
"username": "用户名",
"password": "密码",
"passwordUppercase": "密码必须包含至少1个大写字母",
"passwordLowercase": "密码必须包含至少1个小写字母",
"passwordNumber": "密码必须包含至少1个数字",
"passwordSpecial": "密码必须包含至少1个特殊字符",
"remember": "记住",
"name": "姓名",
"email": "邮箱",
"emailInvalid": "邮箱格式无效",
"passwordMatch": "密码必须一致"
},
"userConfig": {
"host": "主机"
},
"general": {
"sessionTimeout": "会话超时",
"metricsEnabled": "指标",
"metricsPassword": "指标密码"
},
"interface": {
"cidr": "CIDR",
"device": "设备",
"cidrValid": "CIDR必须有效"
},
"otl": "一次性链接",
"stringMalformed": "字符串格式错误",
"body": "正文必须是有效对象",
"hook": "钩子",
"enabled": "已启用",
"mtu": "MTU",
"port": "端口",
"persistentKeepalive": "持久保持活动",
"address": "IP地址",
"dns": "DNS",
"allowedIps": "允许的IP",
"file": "文件"
},
"hooks": {
"preUp": "启动前",
"postUp": "启动后",
"preDown": "关闭前",
"postDown": "关闭后"
}
}

5
src/nuxt.config.ts

@ -32,6 +32,11 @@ export default defineNuxtConfig({
language: 'en-US',
name: 'English',
},
{
code: 'zh',
language: 'zh-CN',
name: '中文',
},
],
defaultLocale: 'en',
vueI18n: './i18n.config.ts',

Loading…
Cancel
Save