export const DEFAULT_LOCALE = 'zh-CN';
export const supportedLocales = ['zh-CN', 'en-US'];

const messages = {
  'zh-CN': {
    'common.account': '账号',
    'common.addDomain': '添加域名',
    'common.actions': '操作',
    'common.cancel': '取消',
    'common.confirm': '确认',
    'common.copy': '复制',
    'common.copied': '已复制',
    'common.delete': '删除',
    'common.details': '详情',
    'common.edit': '修改',
    'common.error': '操作失败',
    'common.loadingConfig': '加载运行配置中',
    'common.logout': '退出登录',
    'common.manual': '手动',
    'common.next': '下一步',
    'common.notConfigured': '未配置',
    'common.notFound': '暂无',
    'common.previous': '上一步',
    'common.refresh': '刷新',
    'common.save': '保存',
    'common.status': '状态',
    'common.user': '用户',
    'common.unsetSendingIp': '未设置发信 IP',
    'shell.skipToMain': '跳至主要内容',
    'shell.mainNavigation': '主导航',
    'shell.openNavigation': '打开主导航',
    'shell.closeNavigation': '关闭主导航',
    'shell.accountMenu': '账户菜单',
    'shell.envReady': '运行环境正常',
    'shell.envNeedsSetup': '运行配置待完善',
    'shell.loadingFailed': '控制台加载失败',
    'shell.retry': '重试',
    'shell.backToLogin': '返回登录',
    'shell.forbiddenTitle': '无权访问',
    'shell.forbiddenDescription': '该页面仅对系统管理员开放。',
    'shell.notFoundTitle': '页面不存在',
    'shell.notFoundDescription': '链接可能已失效，或页面地址输入有误。',
    'shell.backOverview': '返回概览',
    'shell.loadingConsole': '正在加载控制台',
    'shell.loadingPage': '正在加载页面',
    'auth.email': '邮箱',
    'auth.emailPlaceholder': 'name@example.com',
    'auth.backToLogin': '返回登录',
    'auth.forgotPassword': '忘记密码？',
    'auth.forgotPasswordButton': '发送重置邮件',
    'auth.forgotPasswordTitle': '找回密码',
    'auth.login': '登录',
    'auth.loginEyebrow': 'Sign in',
    'auth.loginTitle': '登录控制台',
    'auth.newPassword': '新密码',
    'auth.password': '密码',
    'auth.register': '注册',
    'auth.registerButton': '注册并进入',
    'auth.registerEyebrow': 'Register',
    'auth.registerTitle': '创建账号',
    'auth.resendVerification': '重发验证邮件',
    'auth.resendVerificationButton': '发送验证邮件',
    'auth.resendVerificationTitle': '重发验证邮件',
    'auth.resetPasswordButton': '重置密码',
    'auth.resetPasswordTitle': '重置密码',
    'auth.resetTokenMissing': '重置链接缺少 token，请重新发起密码重置。',
    'auth.submitLogin': '登录',
    'auth.username': '用户名',
    'auth.usernameOrEmail': '用户名或邮箱',
    'auth.valueDns': 'DNS 自动化',
    'auth.valueIsolation': '多用户隔离',
    'auth.valueObservability': '发送可观测',
    'auth.subtitle': '发信域名、DNS、SMTP 与 API 密钥的统一控制台',
    'auth.requestFailed': '请求失败。',
    'dashboard.title': '统计概览',
    'dashboard.verifiedDomains': '已验证域名',
    'dashboard.todaySent': '今日发送量',
    'dashboard.successRate': '成功率',
    'dashboard.bounceRate': '退信率',
    'dashboard.complaintRate': '投诉率',
    'dashboard.lastSentAt': '最近一次发送',
    'dashboard.dnsIssues': 'DNS 异常数量',
    'dashboard.smtpStatus': 'SMTP 状态',
    'dashboard.smtpReady': '可用',
    'dashboard.smtpNotConfigured': '未配置',
    'dashboard.trend': '发送趋势',
    'dashboard.statusDistribution': '状态分布',
    'dashboard.domainRanking': '域名发送排行',
    'dashboard.domainHealth': '域名健康',
    'dashboard.hourlyHeatmap': '小时发送分布',
    'dashboard.deliveryFunnel': '投递漏斗',
    'dashboard.failureReasons': '失败原因排行',
    'dashboard.recentFailures': '最近失败原因',
    'dashboard.recentLogs': '最近发送记录',
    'dashboard.noTrend': '暂无发送趋势数据',
    'dashboard.noDomains': '暂无域名',
    'dashboard.noFailures': '暂无失败记录',
    'dashboard.defaultPasswordWarning': '当前仍在使用默认管理密码，请修改 .env 后重启服务。',
    'dashboard.acceptedMail': '已接收邮件',
    'dashboard.failedMail': '失败邮件',
    'dashboard.dnsActionHint': '优先处理 DNS 异常域名，避免影响新域名投递。',
    'dashboard.statusQueued': '已接收',
    'dashboard.statusFailed': '失败',
    'dashboard.statusUnknown': '未知',
    'dashboard.stageSubmitted': '已提交',
    'dashboard.stageAccepted': '已入队',
    'dashboard.stageDelivered': '已送达',
    'dashboard.stagePending': '等待投递',
    'dashboard.stageFailed': '投递失败',
    'dashboard.opens': '打开',
    'dashboard.clicks': '点击',
    'dashboard.openRate': '打开率',
    'dashboard.clickRate': '点击率',
    'dashboard.clickToOpenRate': '点击打开率',
    'dashboard.unique': '独立',
    'dashboard.total': '总计',
    'dashboard.trackedDelivered': '已追踪送达',
    'dashboard.measuredActivity': '互动次数',
    'dashboard.proxyOpens': '代理打开',
    'dashboard.scannerEvents': '扫描器事件',
    'dashboard.engagementTrend': '打开与点击趋势',
    'dashboard.topLinks': '链接点击排行',
    'dashboard.link': '链接',
    'dashboard.uniqueClicks': '独立点击',
    'dashboard.totalClicks': '总点击',
    'dashboard.lastClicked': '最近点击',
    'dashboard.noEngagement': '暂无互动数据',
    'domains.title': '发信域名',
    'domains.domain': '域名',
    'domains.senderHost': '发信主机',
    'domains.sendingIp': '发信 IP',
    'domains.dnsApi': 'DNS API',
    'domains.smtp': 'SMTP',
    'domains.lastSent': '最近发送',
    'domains.overallStatus': '整体状态',
    'domains.actions': '操作',
    'domains.searchPlaceholder': '搜索域名或发信主机',
    'domains.statusPlaceholder': '整体状态',
    'domains.healthy': '健康',
    'domains.pending': '等待生效',
    'domains.needsAction': '需要处理',
    'domains.waitingDns': '等待 DNS 生效',
    'domains.sendable': '可发送',
    'domains.waitingVerify': '待验证',
    'domains.oneClickDns': '一键 DNS',
    'domains.check': '检查',
    'domains.test': '测试',
    'domains.deleteConfirm': '确认删除该域名？',
    'domainDetail.back': '返回域名列表',
    'domainDetail.overview': '域名概览',
    'domainDetail.danger': '危险操作',
    'domainDetail.deleteHint': '删除域名会移除该域名配置，但不会删除 DNS 服务商中的记录。',
    'domainDetail.editTitle': '修改域名配置',
    'domainDetail.lastCheck': '最后检查',
    'domainDetail.notChecked': '尚未检查',
    'domainDetail.noDnsResult': '尚未生成 DNS 检查结果',
    'domainDetail.currentDnsResult': '当前 DNS 检测结果',
    'domainDetail.recheckAll': '重新检查全部',
    'domainDetail.copyAll': '复制全部配置',
    'domainDetail.noPublicDns': '暂无公共 DNS 查询数据',
    'domainDetail.notFoundRecord': '未发现',
    'domainDetail.needAttention': '需要关注',
    'domainDetail.noSmtpPassword': '请在 SMTP 页面重新设置后复制',
    'domainDetail.noApiToken': '尚未创建',
    'domainDetail.apiExample': '发送 API 示例',
    'domainDetail.placeholder': '配置将在后续版本接入',
    'dnsRecord.hostname': '主机名',
    'dnsRecord.targetValue': '目标值',
    'dnsRecord.currentValue': '当前值',
    'dnsRecord.emptyCurrent': '未查询到记录',
    'dnsRecord.ptrHint': 'PTR 通常需要在服务器商、云厂商或 IP 提供商处配置，DNS API 一般无法直接写入。',
    'dnsRecord.recheck': '重新检测',
    'dnsRecord.copyLabel': '复制',
    'dnsRecord.rootTxt': '根域 TXT',
    'dnsRecord.verificationTxt': '验证 TXT',
    'dnsRecord.dkimTxt': 'DKIM TXT',
    'dnsRecord.dmarcTxt': 'DMARC TXT',
    'dnsRecord.senderA': '发信主机 A',
    'dnsRecord.ptr': '发信 IP PTR',
    'domainHealth.sendingDomain': 'Sending domain',
    'domainHealth.dnsProgress': 'DNS 检查进度',
    'domainHealth.passed': '通过',
    'domainHealth.dnsIssues': 'DNS 异常',
    'domainHealth.dnsApi': 'DNS API',
    'domainHealth.oneClickDns': '一键配置 DNS',
    'domainHealth.checkNow': '立即检查',
    'domainHealth.sendTest': '发送测试邮件',
    'domainHealth.edit': '修改配置',
    'addDomain.title': '添加发信域名',
    'addDomain.stepDomain': '域名信息',
    'addDomain.stepDns': 'DNS 配置方式',
    'addDomain.stepPolicy': 'DKIM / SPF / DMARC',
    'addDomain.stepConfirm': '确认并创建',
    'addDomain.create': '确认创建',
    'addDomain.domainExtra': '填写根域名，不需要 http、路径或邮箱地址。',
    'addDomain.domainRequired': '请输入发信域名',
    'addDomain.senderHostRequired': '请输入发信主机',
    'addDomain.sendingIpRequired': '请输入发信 IP',
    'addDomain.dnsExtra': '未选择时仍可创建域名，稍后手动配置 DNS 或绑定凭据。',
    'addDomain.manualDns': '手动配置 DNS',
    'addDomain.dnsHint': '选择 DNS API 后，域名详情页可以使用“一键配置 DNS”写入验证、DKIM、SPF、DMARC 和发信主机 A 记录。',
    'addDomain.selectorRequired': '请输入 DKIM selector',
    'addDomain.spfExtra': '兼容第三方 SPF include',
    'addDomain.generatedTitle': '创建后会生成以下配置',
    'addDomain.recordVerification': '域名验证 TXT',
    'addDomain.recordDkim': 'DKIM TXT',
    'addDomain.recordSpf': 'SPF TXT',
    'addDomain.recordDmarc': 'DMARC TXT',
    'addDomain.recordSenderA': '发信主机 A 记录',
    'addDomain.recordPtr': 'PTR 反向解析检查提示',
    'addDomain.immediateCheck': '创建后立即检查 DNS',
    'logs.title': '发送记录',
    'logs.time': '时间',
    'logs.recipient': '收件人',
    'logs.domain': '发件域名',
    'logs.errorReason': '错误原因',
    'logs.viewDetail': '查看详情',
    'logs.domainPlaceholder': '发信域名',
    'logs.statusPlaceholder': '状态',
    'logs.recipientPlaceholder': '搜索收件人',
    'logs.detailTitle': '发送详情',
    'logs.deliveryLog': '完整投递日志',
    'logs.copyDeliveryLog': '复制投递日志',
    'logs.noDeliveryLog': '暂无结构化投递日志，可能是历史发送记录。',
    'logs.sender': '发件人',
    'logs.subject': '主题',
    'logs.messageId': 'Message ID',
    'logs.finalResponse': '最终响应',
    'logs.messageBytes': '邮件字节数',
    'logs.queueId': 'Postfix 队列 ID',
    'logs.deliveredAt': '最终投递时间',
    'logs.trackingTimeline': '投递时间线',
    'logs.noTrackingTimeline': '暂无可用的投递时间线。',
    'logs.trackingTimelineTruncated': '时间线仅显示最近 500 条互动事件，汇总统计仍包含全部事件。',
    'logs.trackingLinksTruncated': '链接明细仅显示点击量最高的 200 条，汇总统计仍包含全部链接。',
    'logs.deliveryAttempts': '投递尝试',
    'logs.noDeliveryAttempts': '暂无最终投递回执，可能仍在队列中或属于历史记录。',
    'logs.webhookDeliveries': 'Webhook 回调',
    'logs.noWebhookDeliveries': '暂无关联 Webhook 回调。',
    'logs.detailLoadFailed': '发送详情加载失败。',
    'logs.detailNotFound': '未找到该发送记录。',
    'logs.stageSubmitted': '已提交',
    'logs.stageAccepted': '已入队',
    'logs.stageDelivered': '已送达',
    'logs.stagePending': '等待投递',
    'logs.stageFailed': '投递失败',
    'logs.stageOpened': '已打开',
    'logs.stageClicked': '已点击',
    'logs.stageWebhook': 'Webhook 回调',
    'logs.engagement': '互动追踪',
    'logs.opens': '打开',
    'logs.clicks': '点击',
    'logs.trackingDisabled': '这封邮件发送时未启用打开/点击追踪。',
    'logs.trackingDisabledShort': '未启用',
    'inbox.title': '收件箱',
    'inbox.subtitle': '管理本地收信邮箱，查看通过 MailHub SMTP 接收的邮件。',
    'inbox.createMailbox': '新增收信邮箱',
    'inbox.inboundDisabled': '当前运行配置已关闭入站收信。请设置 INBOUND_ENABLED=true 后重启服务。',
    'inbox.clientHelpTitle': '客户端配置帮助',
    'inbox.clientHelpIntro': '创建邮箱后，点击“客户端配置”可复制第三方客户端所需的收信/发信参数。',
    'inbox.clientHelpImap': '推荐优先使用 IMAP；它会和 MailHub 收件箱保持同步。',
    'inbox.clientHelpPop3': 'POP3 适合把邮件下载到本地；客户端删除邮件后，MailHub 中对应邮件会在退出时移除。',
    'inbox.clientHelpAuth': '用户名使用完整邮箱地址，密码使用创建或重置邮箱时设置的密码。',
    'inbox.clientHelpSecurity': '优先使用 SSL/TLS 端口 993/995/465，或在 143/110/587 上启用 STARTTLS/STLS。',
    'inbox.clientHelpPorts': '服务器防火墙和云安全组需放行 IMAP 143/993、POP3 110/995、SMTP 587/465。',
    'inbox.mailboxes': '收信邮箱',
    'inbox.domainRoutes': '域名收信路由',
    'inbox.mailboxUnit': '邮箱',
    'inbox.catchAllAddress': '收取未知邮件的邮箱',
    'inbox.catchAllDisabled': '未启用',
    'inbox.catchAllTitle': '收取未知邮件',
    'inbox.catchAllExtra': '留空表示拒收未知地址；填写邮箱地址表示投递/转发；填写 /dev/null 表示接收后丢弃。',
    'inbox.mailboxAddress': '邮箱地址',
    'inbox.password': '密码',
    'inbox.passwordRequired': '请输入邮箱密码',
    'inbox.passwordMin': '邮箱密码至少需要 8 位',
    'inbox.generatePassword': '生成',
    'inbox.quotaMb': '配额',
    'inbox.unlimited': '无限制',
    'inbox.aliases': '别名',
    'inbox.aliasesExtra': '每行一个本地部分，例如 sales 会接收 sales@当前域名。',
    'inbox.forwardTo': '转发到',
    'inbox.forwardToExtra': '每行一个或多个邮箱地址，也可用逗号、空格分隔。',
    'inbox.keepForwarded': '保留已转发的邮件',
    'inbox.forwardOnly': '仅转发',
    'inbox.clientConfig': '客户端配置',
    'inbox.mailboxWebhooks': '邮件到达 Webhook',
    'inbox.clientConfigHelpSummary': '推荐优先配置 IMAP 收信；POP3 仅在需要下载到本地时使用。密码只在创建或重置时显示。',
    'inbox.configUsername': '用户名',
    'inbox.configPassword': '密码',
    'inbox.passwordNotShown': '仅创建或重置时显示',
    'inbox.incomingConfig': 'IMAP 配置',
    'inbox.pop3Config': 'POP3 配置',
    'inbox.outgoingConfig': '发信配置',
    'inbox.configProtocol': '协议',
    'inbox.configHost': '主机',
    'inbox.configPort': '端口',
    'inbox.configSecurity': '安全',
    'inbox.configAuthMethod': '认证方式',
    'inbox.unread': '未读',
    'inbox.messageCount': '邮件数',
    'inbox.lastMessageAt': '最近收信',
    'inbox.noDomain': '请先添加域名，再创建该域名下的收信邮箱。',
    'inbox.messages': '入站邮件',
    'inbox.mailboxFilter': '收信邮箱',
    'inbox.searchPlaceholder': '搜索发件人、主题或正文预览',
    'inbox.receivedAt': '收信时间',
    'inbox.subject': '主题',
    'inbox.noSubject': '(无主题)',
    'inbox.sender': '发件人',
    'inbox.mailbox': '收信邮箱',
    'inbox.read': '已读',
    'inbox.preview': '预览',
    'inbox.localPart': '邮箱前缀',
    'inbox.localPartRequired': '请输入邮箱前缀',
    'inbox.localPartInvalid': '邮箱前缀不能包含 @ 或空格',
    'inbox.domainRequired': '请选择域名',
    'inbox.displayName': '显示名称',
    'inbox.messageDetail': '邮件详情',
    'inbox.copyRaw': '复制原文',
    'inbox.recipients': '收件人',
    'inbox.textBody': '文本正文',
    'inbox.htmlBody': 'HTML 预览',
    'inbox.htmlSource': 'HTML 源码',
    'inbox.rawMessage': '原始 MIME',
    'inbox.noTextBody': '暂无文本正文',
    'inbox.noHtmlBody': '暂无 HTML 正文',
    'inbox.noRawMessage': '暂无原始 MIME',
    'inbox.messageNotFound': '邮件不存在或已被删除。',
    'inbox.detailLoadFailed': '邮件详情加载失败。',
    'logs.trackingScope': '统计范围',
    'logs.messageLevel': '消息级（多收件人）',
    'logs.recipientLevel': '单收件人',
    'logs.firstOpened': '首次打开',
    'logs.lastOpened': '最近打开',
    'logs.firstClicked': '首次点击',
    'logs.lastClicked': '最近点击',
    'logs.proxyOpens': '代理打开',
    'logs.scannerEvents': '扫描器事件',
    'logs.statusQueued': '队列中',
    'logs.statusSent': '已送达',
    'logs.statusDeferred': '暂时失败',
    'logs.statusBounced': '已退信',
    'logs.statusFailed': '失败',
    'smtp.connectionTitle': 'SMTP 连接信息',
    'smtp.loginCredentialsTitle': 'SMTP 凭据',
    'smtp.username': '用户名',
    'smtp.password': '密码',
    'smtp.usernameRequired': '请输入 SMTP Username',
    'smtp.passwordRequired': '请输入 SMTP Password',
    'smtp.passwordSet': '已设置',
    'smtp.passwordEmpty': '未设置',
    'smtp.passwordUnavailable': '请重新设置后复制',
    'smtp.create': '新增凭据',
    'smtp.createTitle': '新增 SMTP 凭据',
    'smtp.editTitle': '编辑 SMTP 凭据',
    'smtp.deleteConfirm': '确认删除该 SMTP 登录凭据？',
    'smtp.passwordExtra': '留空保存时会保留原密码；出于安全原因，已保存密码不会再次显示。',
    'smtp.regenerate': '重新生成密码',
    'smtp.resetToCopy': '请重新设置后复制',
    'smtpRelay.title': '发送中继',
    'smtpRelay.create': '新增出口',
    'smtpRelay.createTitle': '新增发送中继',
    'smtpRelay.editTitle': '编辑发送中继',
    'smtpRelay.name': '名称',
    'smtpRelay.nameRequired': '请输入出口名称',
    'smtpRelay.server': '服务器',
    'smtpRelay.hostRequired': '请输入 SMTP Host',
    'smtpRelay.portRequired': '请输入 SMTP Port',
    'smtpRelay.username': '用户名',
    'smtpRelay.password': '密码',
    'smtpRelay.passwordSet': '已设置',
    'smtpRelay.passwordEmpty': '未设置',
    'smtpRelay.passwordExtra': '留空保存时会保留原密码；出于安全原因，已保存密码不会再次显示。',
    'smtpRelay.generatePassword': '生成密码',
    'smtpRelay.heloExtra': '留空时使用系统默认 HELO。',
    'smtpRelay.default': '默认',
    'smtpRelay.domainDefault': '默认发信 SMTP 出口',
    'smtpRelay.domainDefaultExtra': '未选择时按请求指定、用户默认出口、系统全局 SMTP 的顺序选择。',
    'smtpRelay.useResolutionOrder': '按默认选择顺序',
    'smtpRelay.deleteConfirm': '确认删除该 SMTP 出口？绑定到该出口的域名会改为按默认顺序选择。',
    'dnsApi.title': 'DNS 集成凭据',
    'dnsApi.createTitle': '新增 DNS 集成凭据',
    'dnsApi.editTitle': '编辑',
    'dnsApi.zone': 'Zone / 根域名',
    'dnsApi.zoneRequired': '请输入 Zone 或根域名',
    'dnsApi.zoneExtra': '填写该账号下任一可管理 Zone 用于连接测试；一键配置时会按当前发信域名自动匹配 Zone。',
    'dnsApi.cloudflareZoneExtra': 'Cloudflare 可填写任一可访问 Zone 用于测试；一键配置时会按当前发信域名自动匹配 Zone。',
    'dnsApi.tokenExtra': '需要 Zone DNS Edit 权限。',
    'dnsApi.keepSecret': '留空表示保留原密钥。',
    'dnsApi.save': '保存修改',
    'dnsApi.create': '新增凭据',
    'dnsApi.secretHint': '密钥只在服务端加密保存，不会在列表中回显。',
    'dnsApi.deleteConfirm': '确认删除该 DNS 集成凭据？删除后将无法再通过此 Provider 管理对应 Zone。',
    'settings.checkItem': '检查项',
    'settings.deliveryChecks': '发信环境检查',
    'settings.noPermission': '当前账号没有系统设置权限。',
    'settings.save': '保存设置',
    'settings.engagementTracking': '默认启用打开与点击追踪',
    'admin.title': '管理中心',
    'admin.users': '用户',
    'admin.resources': '资源',
    'admin.migration': '合并迁移',
    'admin.systemEmail': '系统邮件',
    'admin.auditLogs': '审计日志',
    'metrics.accepted': '已接收',
    'metrics.failed': '失败',
    'metrics.recipients': '收件人',
    'metrics.total': '总量',
    'status.success': '已通过',
    'status.pending': '等待生效',
    'status.error': '配置错误',
    'status.idle': '未配置',
    'tokens.createTitle': '创建 API 密钥',
    'tokens.subtitle': '按最小权限原则创建、更新或撤销用于发信和邮箱自动化的访问令牌。',
    'tokens.name': '名称',
    'tokens.namePlaceholder': 'Production API',
    'tokens.nameRequired': '请输入密钥名称',
    'tokens.create': '创建密钥',
    'tokens.edit': '编辑密钥',
    'tokens.editTitle': '编辑 API 密钥',
    'tokens.listTitle': 'API 密钥',
    'tokens.prefix': 'Token 前缀',
    'tokens.scopes': '权限范围',
    'tokens.scopesRequired': '请至少选择一项权限',
    'tokens.scopesExtra': '发信使用 send；邮箱资源读取/创建使用 mailboxes:read、mailboxes:write；读取邮件内容使用 messages:read。',
    'tokens.mailboxAccess': '邮件读取范围',
    'tokens.mailboxAccessOwner': '当前账号的全部邮箱',
    'tokens.mailboxAccessSelected': '指定邮箱',
    'tokens.mailboxAccessAll': '全系统邮箱（管理员）',
    'tokens.mailboxAccessExtra': '启用 messages:read 后配置；同时约束该 Token 的邮箱列表。指定邮箱按资源 ID 授权；全系统范围只对管理员开放。',
    'tokens.mailboxIds': '授权邮箱',
    'tokens.mailboxIdsRequired': '请至少选择一个邮箱',
    'tokens.mailboxIdsPlaceholder': '选择可读取邮件的邮箱',
    'tokens.status': '状态',
    'tokens.statusActive': '生效中',
    'tokens.statusExpired': '已过期',
    'tokens.statusRevoked': '已撤销',
    'tokens.expiresAt': '到期时间',
    'tokens.expiresAtExtra': '留空表示长期有效；使用本地时间。',
    'tokens.fullToken': '完整 Token',
    'tokens.copyFull': '复制完整 Token',
    'tokens.copyPrefix': '复制前缀',
    'tokens.createdTitle': 'API 密钥已创建',
    'tokens.createdWarning': '完整 Token 已加密保存，之后仍可在列表或详情中复制。请仅存放在可信的服务端环境。',
    'tokens.createdSuccess': 'API 密钥已创建',
    'tokens.rotatedTitle': 'API 密钥已重新生成',
    'tokens.rotatedSuccess': 'API 密钥已重新生成，旧值已立即失效',
    'tokens.rotatedWarning': '旧 Token 已立即失效。请尽快更新所有调用方，新的完整 Token 之后仍可在列表或详情中复制。',
    'tokens.deletedSuccess': 'API 密钥已删除',
    'tokens.updatedSuccess': 'API 密钥已更新',
    'tokens.revokedSuccess': 'API 密钥已撤销',
    'tokens.secretAvailable': '完整 Token 已加密保存，可随时复制。',
    'tokens.secretUnavailable': '该历史 Token 不可恢复，只能通过前缀识别。重新生成后旧值会立即失效。',
    'tokens.recoverable': '可复制',
    'tokens.unrecoverable': '不可恢复',
    'tokens.rotate': '重新生成',
    'tokens.rotateConfirm': '重新生成 API 密钥？',
    'tokens.rotateConfirmDescription': '旧 Token 会立即失效，所有仍使用旧值的调用都会失败。此操作无法撤销。',
    'tokens.lastUsed': '最近使用',
    'tokens.neverUsed': '未使用',
    'tokens.createdAt': '创建时间',
    'tokens.actions': '操作',
    'tokens.deleteConfirm': '确认删除该 API 密钥？',
    'tokens.revoke': '撤销密钥',
    'tokens.revokeConfirm': '撤销后该 API 密钥将立即失效，确认继续？',
    'tokens.copyCreated': '复制完整 Token',
    'tokens.prefixOnlyHelp': '新 API 密钥会加密保存并支持完整复制；旧版历史 Token 可能仅保留前缀，需要重新生成后才能恢复完整复制能力。',
    'tokens.docsTitle': 'API 使用文档',
    'tokens.endpoint': 'API Endpoint',
    'tokens.mailboxEndpoint': '邮箱 API Endpoint',
    'tokens.authHeader': '认证方式',
    'tokens.authHeaderValue': 'Authorization: Bearer <USER_API_TOKEN>',
    'tokens.contentType': 'Content-Type',
    'tokens.requestFields': '请求字段',
    'tokens.fieldFrom': 'from：发件地址，域名必须已添加并通过验证。',
    'tokens.fieldTo': 'to：收件人地址，支持单个邮箱或邮箱数组。',
    'tokens.fieldSubject': 'subject：邮件主题。',
    'tokens.fieldText': 'text：纯文本正文。',
    'tokens.fieldHtml': 'html：HTML 正文，可选。',
    'tokens.curlExample': 'curl 示例',
    'tokens.nodeExample': 'Node / Fetch 示例',
    'tokens.requestExample': '请求 Body 示例',
    'tokens.responseExample': '成功响应示例',
    'tokens.sendApi': '发信 API',
    'tokens.mailboxApi': '创建邮箱 API',
    'tokens.mailboxApiHint': '长期邮箱使用 mode=permanent；临时邮箱使用 mode=temporary 并提供 expiresInMinutes。临时邮箱可省略 address，服务端会按 domain 自动生成地址和密码。',
    'tokens.permanentMailbox': '创建长期邮箱',
    'tokens.temporaryMailbox': '创建临时邮箱',
    'tokens.mailboxResponse': '创建结果与客户端配置',
    'tokens.messagesApi': '收信 API',
    'tokens.messagesApiHint': '需要 messages:read 权限，并受 Token 的邮件读取范围限制。列表支持分页与邮箱、文件夹、已读状态、关键词筛选。',
    'tokens.messagesList': '查询邮件列表',
    'tokens.messageDetail': '读取邮件详情',
    'tokens.mailboxFolders': '查询邮箱文件夹',
    'tokens.messagesFilters': '筛选参数：page/pageSize 控制分页；mailboxId 限定邮箱；folder 限定文件夹；read 使用 true/false；q 搜索发件人、收件人、主题、Message ID 与摘要。',
    'tokens.messagesAccess': '范围说明：当前账号覆盖 Token 所有者的邮箱；指定邮箱仅覆盖所选 ID；全系统邮箱只允许管理员显式选择。',
    'tokens.securityTips': '安全建议',
    'tokens.securityTipStore': '只在服务端环境保存 Token，不要放进浏览器前端代码或公开仓库。',
    'tokens.securityTipRotate': '不同环境使用不同 Token，泄露后立即重新生成并更新所有调用方。',
    'tokens.securityTipScopes': '只授予实际需要的权限；给自动化邮箱创建任务时无需授予 send。',
    'tokens.securityTipDomain': 'From 域名必须属于当前账号，建议先完成 DNS 验证再接入生产发送。',
    'tokens.noTokenHint': '创建 API 密钥后可在列表和详情中复制完整 Token，并按最小权限限制邮件读取范围。',
    'webhooks.title': 'Webhooks',
    'webhooks.subtitle': '在投递状态变为已送达、退信或失败时，向你的 HTTPS 端点推送通知。',
    'webhooks.create': '新建 Webhook',
    'webhooks.createTitle': '新建 Webhook',
    'webhooks.editTitle': '编辑 Webhook',
    'webhooks.name': '名称',
    'webhooks.namePlaceholder': 'Production deliveries',
    'webhooks.nameRequired': '请输入 Webhook 名称',
    'webhooks.url': '回调 URL',
    'webhooks.urlPlaceholder': 'https://example.com/webhooks/mailhub',
    'webhooks.urlRequired': '请输入回调 URL',
    'webhooks.urlHint': '生产环境请使用 HTTPS。签名校验使用 X-MailHub-Signature 请求头。',
    'webhooks.events': '订阅事件',
    'webhooks.eventsRequired': '请至少选择一个事件',
    'webhooks.eventSent': '已送达',
    'webhooks.eventBounced': '已退信',
    'webhooks.eventFailed': '失败',
    'webhooks.eventOpened': '已打开',
    'webhooks.eventClicked': '已点击',
    'webhooks.eventReceived': '邮件到达',
    'webhooks.enabled': '启用',
    'webhooks.disabled': '已停用',
    'webhooks.scope': '作用域',
    'webhooks.scopeAccount': '账号级',
    'webhooks.scopeDomain': '域名级',
    'webhooks.scopeMailbox': '收信邮箱',
    'webhooks.domain': '域名',
    'webhooks.domainAccount': '整个账号',
    'webhooks.domainOverrideHelp': '若某域名对某一事件存在任何已启用的端点，则该事件不会再投递到账号级端点。',
    'webhooks.mailboxReceiptHelp': '仅在邮件成功保存到该邮箱后投递 email.received；仅转发而未保留的邮件不会触发。',
    'webhooks.secret': '签名密钥',
    'webhooks.secretPrefix': '密钥前缀',
    'webhooks.secretCreatedTitle': 'Webhook 密钥已创建',
    'webhooks.secretRotatedTitle': 'Webhook 密钥已轮换',
    'webhooks.secretCreatedWarning': '完整密钥只会显示这一次。关闭后无法再次查看，请立即复制并保存到安全位置。',
    'webhooks.copySecret': '复制完整密钥',
    'webhooks.rotateSecret': '轮换密钥',
    'webhooks.rotateConfirm': '确认轮换该 Webhook 的签名密钥？旧密钥将立即失效。',
    'webhooks.test': '发送测试',
    'webhooks.testQueued': '测试投递已入队',
    'webhooks.deleteConfirm': '确认删除该 Webhook？相关投递记录也会一并删除。',
    'webhooks.empty': '暂无 Webhook。创建后即可接收投递状态回调。',
    'webhooks.listTitle': '端点列表',
    'webhooks.loadFailed': 'Webhook 端点加载失败',
    'webhooks.recentDeliveriesUnavailable': '最近投递状态暂不可用',
    'webhooks.resourcesUnavailable': '域名或邮箱选项暂不可用',
    'webhooks.actions': '操作',
    'webhooks.deliveriesTitle': '投递记录',
    'webhooks.deliveriesEmpty': '暂无投递记录',
    'webhooks.deliveriesFilterWebhook': '按 Webhook 筛选',
    'webhooks.deliveriesFilterStatus': '按状态筛选',
    'webhooks.deliveriesFilterEvent': '按事件筛选',
    'webhooks.allWebhooks': '全部 Webhook',
    'webhooks.allStatuses': '全部状态',
    'webhooks.allEvents': '全部事件',
    'webhooks.statusPending': '待投递',
    'webhooks.statusProcessing': '投递中',
    'webhooks.statusSuccess': '成功',
    'webhooks.statusDead': '已放弃',
    'webhooks.attemptCount': '尝试次数',
    'webhooks.responseStatus': 'HTTP 状态',
    'webhooks.error': '错误',
    'webhooks.replay': '重放',
    'webhooks.replaySuccess': '投递已重新入队',
    'webhooks.lastAttemptAt': '最近尝试',
    'webhooks.nextAttemptAt': '下次尝试',
    'webhooks.createdAt': '创建时间',
    'webhooks.viewDeliveries': '查看投递',
    'webhooks.docsTitle': '回调说明',
    'webhooks.docsSignature': '使用 HMAC-SHA256 校验请求体；签名放在 X-MailHub-Signature。',
    'webhooks.docsEvents': '事件类型：sent、bounced、failed、opened、clicked；收信邮箱可额外订阅 received。',
    'testMail.title': '发送测试邮件',
    'testMail.fromRequired': '请输入发件人',
    'testMail.toRequired': '请输入收件人',
    'actions.domainCreated': '域名已创建',
    'actions.dnsCheckCompleted': 'DNS 检查已完成',
    'actions.dnsCheckRefreshed': 'DNS 检查已刷新',
    'actions.dnsApplyCompleted': 'DNS 写入请求已完成',
    'actions.dnsApplyPartial': 'DNS 写入部分失败',
    'actions.domainSaved': '域名配置已保存',
    'actions.domainDeleted': '域名已删除',
    'actions.testMailQueued': '已提交到发信队列',
    'actions.dnsApiCreated': 'DNS API 已新增',
    'actions.dnsApiUpdated': 'DNS API 已更新',
    'actions.dnsApiDeleted': 'DNS API 已删除',
    'actions.dnsApiTestCompleted': '连接测试完成',
    'actions.smtpCreated': 'SMTP 登录凭据已新增',
    'actions.smtpUpdated': 'SMTP 登录凭据已更新',
    'actions.smtpDeleted': 'SMTP 登录凭据已删除',
    'actions.smtpRelayCreated': 'SMTP 出口已新增',
    'actions.smtpRelayUpdated': 'SMTP 出口已更新',
    'actions.smtpRelayDeleted': 'SMTP 出口已删除',
    'actions.inboundMailboxCreated': '收信邮箱已新增',
    'actions.settingsSaved': '系统设置已保存',
    'actions.webhookCreated': 'Webhook 已创建',
    'actions.webhookUpdated': 'Webhook 已更新',
    'actions.webhookDeleted': 'Webhook 已删除',
    'actions.webhookSecretRotated': 'Webhook 密钥已轮换',
    'actions.webhookTestQueued': 'Webhook 测试已入队',
    'actions.webhookDeliveryReplayed': 'Webhook 投递已重放',
    'nav.dashboard': '仪表盘',
    'nav.overview': '概览',
    'nav.activity': '发送活动',
    'nav.domains': '发信域名',
    'nav.dnsApi': 'DNS 集成',
    'nav.smtp': 'SMTP 与中继',
    'nav.inbox': '收件箱',
    'nav.tokens': 'API 密钥',
    'nav.logs': '发送记录',
    'nav.webhooks': 'Webhooks',
    'nav.smtpIntegration': 'SMTP 与中继',
    'nav.apiKeys': 'API 密钥',
    'nav.dnsIntegration': 'DNS 集成',
    'nav.adminCenter': '管理中心',
    'nav.admin': '管理中心',
    'nav.settings': '系统设置',
    'nav.group.overview': '概览',
    'nav.group.delivery': '投递',
    'nav.group.operations': '运行中心',
    'nav.group.integrations': '接入与集成',
    'nav.group.system': '系统'
  },
  'en-US': {
    'common.account': 'Account',
    'common.addDomain': 'Add Domain',
    'common.actions': 'Actions',
    'common.cancel': 'Cancel',
    'common.confirm': 'Confirm',
    'common.copy': 'Copy',
    'common.copied': 'Copied',
    'common.delete': 'Delete',
    'common.details': 'Details',
    'common.edit': 'Edit',
    'common.error': 'Operation failed',
    'common.loadingConfig': 'Loading runtime config',
    'common.logout': 'Log out',
    'common.manual': 'Manual',
    'common.next': 'Next',
    'common.notConfigured': 'Not configured',
    'common.notFound': 'None',
    'common.previous': 'Previous',
    'common.refresh': 'Refresh',
    'common.save': 'Save',
    'common.status': 'Status',
    'common.user': 'User',
    'common.unsetSendingIp': 'Sending IP not set',
    'shell.skipToMain': 'Skip to main content',
    'shell.mainNavigation': 'Main navigation',
    'shell.openNavigation': 'Open main navigation',
    'shell.closeNavigation': 'Close main navigation',
    'shell.accountMenu': 'Account menu',
    'shell.envReady': 'Environment healthy',
    'shell.envNeedsSetup': 'Environment needs setup',
    'shell.loadingFailed': 'Console failed to load',
    'shell.retry': 'Retry',
    'shell.backToLogin': 'Back to login',
    'shell.forbiddenTitle': 'Access denied',
    'shell.forbiddenDescription': 'This page is available to system administrators only.',
    'shell.notFoundTitle': 'Page not found',
    'shell.notFoundDescription': 'The link may be stale or the address may be incorrect.',
    'shell.backOverview': 'Back to overview',
    'shell.loadingConsole': 'Loading console',
    'shell.loadingPage': 'Loading page',
    'auth.email': 'Email',
    'auth.emailPlaceholder': 'name@example.com',
    'auth.backToLogin': 'Back to sign in',
    'auth.forgotPassword': 'Forgot password?',
    'auth.forgotPasswordButton': 'Send reset email',
    'auth.forgotPasswordTitle': 'Recover password',
    'auth.login': 'Sign in',
    'auth.loginEyebrow': 'Sign in',
    'auth.loginTitle': 'Sign in to console',
    'auth.newPassword': 'New password',
    'auth.password': 'Password',
    'auth.register': 'Register',
    'auth.registerButton': 'Create account',
    'auth.registerEyebrow': 'Register',
    'auth.registerTitle': 'Create account',
    'auth.resendVerification': 'Resend verification email',
    'auth.resendVerificationButton': 'Send verification email',
    'auth.resendVerificationTitle': 'Resend verification email',
    'auth.resetPasswordButton': 'Reset password',
    'auth.resetPasswordTitle': 'Reset password',
    'auth.resetTokenMissing': 'The reset link is missing a token. Please request a new password reset.',
    'auth.submitLogin': 'Sign in',
    'auth.username': 'Username',
    'auth.usernameOrEmail': 'Username or email',
    'auth.valueDns': 'DNS automation',
    'auth.valueIsolation': 'User isolation',
    'auth.valueObservability': 'Delivery visibility',
    'auth.subtitle': 'One console for sending domains, DNS, SMTP, and API keys',
    'auth.requestFailed': 'Request failed.',
    'dashboard.title': 'Analytics',
    'dashboard.verifiedDomains': 'Verified domains',
    'dashboard.todaySent': 'Sent today',
    'dashboard.successRate': 'Success rate',
    'dashboard.bounceRate': 'Bounce rate',
    'dashboard.complaintRate': 'Complaint rate',
    'dashboard.lastSentAt': 'Last sent',
    'dashboard.dnsIssues': 'DNS issues',
    'dashboard.smtpStatus': 'SMTP status',
    'dashboard.smtpReady': 'Ready',
    'dashboard.smtpNotConfigured': 'Not configured',
    'dashboard.trend': 'Sending trend',
    'dashboard.statusDistribution': 'Status distribution',
    'dashboard.domainRanking': 'Domain ranking',
    'dashboard.domainHealth': 'Domain health',
    'dashboard.hourlyHeatmap': 'Hourly distribution',
    'dashboard.deliveryFunnel': 'Delivery funnel',
    'dashboard.failureReasons': 'Top failure reasons',
    'dashboard.recentFailures': 'Recent failures',
    'dashboard.recentLogs': 'Recent sending logs',
    'dashboard.noTrend': 'No trend data yet',
    'dashboard.noDomains': 'No domains yet',
    'dashboard.noFailures': 'No failures yet',
    'dashboard.defaultPasswordWarning': 'The default admin password is still in use. Update .env and restart the service.',
    'dashboard.acceptedMail': 'Accepted mail',
    'dashboard.failedMail': 'Failed mail',
    'dashboard.dnsActionHint': 'Handle domains with DNS issues first to protect delivery for new senders.',
    'dashboard.statusQueued': 'Accepted',
    'dashboard.statusFailed': 'Failed',
    'dashboard.statusUnknown': 'Unknown',
    'dashboard.stageSubmitted': 'Submitted',
    'dashboard.stageAccepted': 'Accepted',
    'dashboard.stageDelivered': 'Delivered',
    'dashboard.stagePending': 'Pending',
    'dashboard.stageFailed': 'Failed',
    'dashboard.opens': 'Opens',
    'dashboard.clicks': 'Clicks',
    'dashboard.openRate': 'Open rate',
    'dashboard.clickRate': 'Click rate',
    'dashboard.clickToOpenRate': 'Click-to-open rate',
    'dashboard.unique': 'unique',
    'dashboard.total': 'total',
    'dashboard.trackedDelivered': 'Tracked delivered',
    'dashboard.measuredActivity': 'Measured activity',
    'dashboard.proxyOpens': 'Proxy opens',
    'dashboard.scannerEvents': 'Scanner events',
    'dashboard.engagementTrend': 'Open and click trend',
    'dashboard.topLinks': 'Top links',
    'dashboard.link': 'Link',
    'dashboard.uniqueClicks': 'Unique clicks',
    'dashboard.totalClicks': 'Total clicks',
    'dashboard.lastClicked': 'Last clicked',
    'dashboard.noEngagement': 'No engagement data yet',
    'domains.title': 'Sending domains',
    'domains.domain': 'Domain',
    'domains.senderHost': 'Sending host',
    'domains.sendingIp': 'Sending IP',
    'domains.dnsApi': 'DNS API',
    'domains.smtp': 'SMTP',
    'domains.lastSent': 'Last sent',
    'domains.overallStatus': 'Overall status',
    'domains.actions': 'Actions',
    'domains.searchPlaceholder': 'Search domain or sending host',
    'domains.statusPlaceholder': 'Overall status',
    'domains.healthy': 'Healthy',
    'domains.pending': 'Pending',
    'domains.needsAction': 'Needs action',
    'domains.waitingDns': 'Waiting for DNS',
    'domains.sendable': 'Sendable',
    'domains.waitingVerify': 'Waiting verification',
    'domains.oneClickDns': 'One-click DNS',
    'domains.check': 'Check',
    'domains.test': 'Test',
    'domains.deleteConfirm': 'Delete this domain?',
    'domainDetail.back': 'Back to domains',
    'domainDetail.overview': 'Domain overview',
    'domainDetail.danger': 'Danger zone',
    'domainDetail.deleteHint': 'Deleting the domain removes MailHub configuration, but does not delete records at your DNS provider.',
    'domainDetail.editTitle': 'Edit domain settings',
    'domainDetail.lastCheck': 'Last check',
    'domainDetail.notChecked': 'Not checked',
    'domainDetail.noDnsResult': 'No DNS check result yet',
    'domainDetail.currentDnsResult': 'Current DNS results',
    'domainDetail.recheckAll': 'Recheck all',
    'domainDetail.copyAll': 'Copy all records',
    'domainDetail.noPublicDns': 'No public DNS query data',
    'domainDetail.notFoundRecord': 'Not found',
    'domainDetail.needAttention': 'Needs attention',
    'domainDetail.noSmtpPassword': 'Reset it on the SMTP page before copying',
    'domainDetail.noApiToken': 'No token yet',
    'domainDetail.apiExample': 'Sending API example',
    'domainDetail.placeholder': 'configuration will be connected in a later version',
    'dnsRecord.hostname': 'Hostname',
    'dnsRecord.targetValue': 'Target value',
    'dnsRecord.currentValue': 'Current value',
    'dnsRecord.emptyCurrent': 'No record found',
    'dnsRecord.ptrHint': 'PTR is usually configured at your server, cloud, or IP provider. DNS APIs usually cannot write it directly.',
    'dnsRecord.recheck': 'Recheck',
    'dnsRecord.copyLabel': 'Copy',
    'dnsRecord.rootTxt': 'Root TXT',
    'dnsRecord.verificationTxt': 'Verification TXT',
    'dnsRecord.dkimTxt': 'DKIM TXT',
    'dnsRecord.dmarcTxt': 'DMARC TXT',
    'dnsRecord.senderA': 'Sending host A',
    'dnsRecord.ptr': 'Sending IP PTR',
    'domainHealth.sendingDomain': 'Sending domain',
    'domainHealth.dnsProgress': 'DNS check progress',
    'domainHealth.passed': 'passed',
    'domainHealth.dnsIssues': 'DNS issues',
    'domainHealth.dnsApi': 'DNS API',
    'domainHealth.oneClickDns': 'Configure DNS',
    'domainHealth.checkNow': 'Check now',
    'domainHealth.sendTest': 'Send test email',
    'domainHealth.edit': 'Edit settings',
    'addDomain.title': 'Add sending domain',
    'addDomain.stepDomain': 'Domain',
    'addDomain.stepDns': 'DNS method',
    'addDomain.stepPolicy': 'DKIM / SPF / DMARC',
    'addDomain.stepConfirm': 'Confirm',
    'addDomain.create': 'Create domain',
    'addDomain.domainExtra': 'Use the root domain without http, paths, or email addresses.',
    'addDomain.domainRequired': 'Enter the sending domain',
    'addDomain.senderHostRequired': 'Enter the sending host',
    'addDomain.sendingIpRequired': 'Enter the sending IP',
    'addDomain.dnsExtra': 'You can create the domain without a credential and configure DNS manually later.',
    'addDomain.manualDns': 'Manual DNS',
    'addDomain.dnsHint': 'With a DNS API credential, the detail page can write verification, DKIM, SPF, DMARC, and sending host A records.',
    'addDomain.selectorRequired': 'Enter the DKIM selector',
    'addDomain.spfExtra': 'Third-party SPF includes',
    'addDomain.generatedTitle': 'MailHub will generate',
    'addDomain.recordVerification': 'Domain verification TXT',
    'addDomain.recordDkim': 'DKIM TXT',
    'addDomain.recordSpf': 'SPF TXT',
    'addDomain.recordDmarc': 'DMARC TXT',
    'addDomain.recordSenderA': 'Sending host A record',
    'addDomain.recordPtr': 'PTR reverse DNS check hint',
    'addDomain.immediateCheck': 'Check DNS immediately after creation',
    'logs.title': 'Sending logs',
    'logs.time': 'Time',
    'logs.recipient': 'Recipient',
    'logs.domain': 'Sending domain',
    'logs.errorReason': 'Error reason',
    'logs.viewDetail': 'View detail',
    'logs.domainPlaceholder': 'Sending domain',
    'logs.statusPlaceholder': 'Status',
    'logs.recipientPlaceholder': 'Search recipient',
    'logs.detailTitle': 'Sending detail',
    'logs.deliveryLog': 'Full delivery log',
    'logs.copyDeliveryLog': 'Copy delivery log',
    'logs.noDeliveryLog': 'No structured delivery log. This may be a historical event.',
    'logs.sender': 'Sender',
    'logs.subject': 'Subject',
    'logs.messageId': 'Message ID',
    'logs.finalResponse': 'Final response',
    'logs.messageBytes': 'Message bytes',
    'logs.queueId': 'Postfix Queue ID',
    'logs.deliveredAt': 'Delivered at',
    'logs.trackingTimeline': 'Delivery timeline',
    'logs.noTrackingTimeline': 'No delivery timeline is available.',
    'logs.trackingTimelineTruncated': 'Only the latest 500 engagement events are shown; summary metrics include all events.',
    'logs.trackingLinksTruncated': 'Only the top 200 links by clicks are shown; summary metrics include all links.',
    'logs.deliveryAttempts': 'Delivery attempts',
    'logs.noDeliveryAttempts': 'No final delivery receipt yet. The message may still be queued or historical.',
    'logs.webhookDeliveries': 'Webhook callbacks',
    'logs.noWebhookDeliveries': 'No related webhook callbacks.',
    'logs.detailLoadFailed': 'Failed to load sending detail.',
    'logs.detailNotFound': 'Sending record not found.',
    'logs.stageSubmitted': 'Submitted',
    'logs.stageAccepted': 'Accepted',
    'logs.stageDelivered': 'Delivered',
    'logs.stagePending': 'Pending',
    'logs.stageFailed': 'Failed',
    'logs.stageOpened': 'Opened',
    'logs.stageClicked': 'Clicked',
    'logs.stageWebhook': 'Webhook callback',
    'logs.engagement': 'Engagement tracking',
    'logs.opens': 'Opens',
    'logs.clicks': 'Clicks',
    'logs.trackingDisabled': 'Open and click tracking was not enabled when this email was sent.',
    'logs.trackingDisabledShort': 'Off',
    'logs.trackingScope': 'Tracking scope',
    'logs.messageLevel': 'Message-level (multiple recipients)',
    'logs.recipientLevel': 'Single recipient',
    'logs.firstOpened': 'First opened',
    'logs.lastOpened': 'Last opened',
    'logs.firstClicked': 'First clicked',
    'logs.lastClicked': 'Last clicked',
    'logs.proxyOpens': 'Proxy opens',
    'logs.scannerEvents': 'Scanner events',
    'logs.statusQueued': 'Queued',
    'logs.statusSent': 'Sent',
    'logs.statusDeferred': 'Deferred',
    'logs.statusBounced': 'Bounced',
    'logs.statusFailed': 'Failed',
    'inbox.title': 'Inbox',
    'inbox.subtitle': 'Manage local receiving mailboxes and read mail accepted by MailHub SMTP.',
    'inbox.createMailbox': 'New mailbox',
    'inbox.inboundDisabled': 'Inbound receiving is disabled. Set INBOUND_ENABLED=true and restart the service.',
    'inbox.clientHelpTitle': 'Client setup help',
    'inbox.clientHelpIntro': 'After creating a mailbox, open Client configuration to copy the receiving and sending settings for third-party mail apps.',
    'inbox.clientHelpImap': 'Use IMAP first when possible; it stays synchronized with the MailHub inbox.',
    'inbox.clientHelpPop3': 'Use POP3 when you want to download mail locally; messages deleted by the client are removed from MailHub on quit.',
    'inbox.clientHelpAuth': 'Use the full email address as the username and the password set when the mailbox was created or reset.',
    'inbox.clientHelpSecurity': 'Prefer SSL/TLS ports 993/995/465, or enable STARTTLS/STLS on 143/110/587.',
    'inbox.clientHelpPorts': 'Allow IMAP 143/993, POP3 110/995, and SMTP 587/465 in the server firewall and cloud security group.',
    'inbox.mailboxes': 'Mailboxes',
    'inbox.domainRoutes': 'Domain receiving routes',
    'inbox.mailboxUnit': 'mailboxes',
    'inbox.catchAllAddress': 'Catch-all mailbox',
    'inbox.catchAllDisabled': 'Disabled',
    'inbox.catchAllTitle': 'Catch-all mailbox',
    'inbox.catchAllExtra': 'Leave empty to reject unknown recipients. Use an email address to deliver/forward, or /dev/null to accept and discard.',
    'inbox.mailboxAddress': 'Mailbox address',
    'inbox.password': 'Password',
    'inbox.passwordRequired': 'Enter the mailbox password',
    'inbox.passwordMin': 'Mailbox password must be at least 8 characters',
    'inbox.generatePassword': 'Generate',
    'inbox.quotaMb': 'Quota',
    'inbox.unlimited': 'Unlimited',
    'inbox.aliases': 'Aliases',
    'inbox.aliasesExtra': 'One local part per line. For example, sales accepts sales@this domain.',
    'inbox.forwardTo': 'Forward to',
    'inbox.forwardToExtra': 'One or more email addresses, separated by line breaks, commas, or spaces.',
    'inbox.keepForwarded': 'Keep forwarded mail',
    'inbox.forwardOnly': 'Forward only',
    'inbox.clientConfig': 'Client configuration',
    'inbox.mailboxWebhooks': 'Mail arrival webhook',
    'inbox.clientConfigHelpSummary': 'Configure IMAP first for receiving mail. Use POP3 only when you need local download behavior. Passwords are shown only on create or reset.',
    'inbox.configUsername': 'Username',
    'inbox.configPassword': 'Password',
    'inbox.passwordNotShown': 'Shown only on create or reset',
    'inbox.incomingConfig': 'IMAP configuration',
    'inbox.pop3Config': 'POP3 configuration',
    'inbox.outgoingConfig': 'Outgoing configuration',
    'inbox.configProtocol': 'Protocol',
    'inbox.configHost': 'Host',
    'inbox.configPort': 'Port',
    'inbox.configSecurity': 'Security',
    'inbox.configAuthMethod': 'Auth method',
    'inbox.unread': 'Unread',
    'inbox.messageCount': 'Messages',
    'inbox.lastMessageAt': 'Last received',
    'inbox.noDomain': 'Add a domain before creating receiving mailboxes for it.',
    'inbox.messages': 'Inbound messages',
    'inbox.mailboxFilter': 'Mailbox',
    'inbox.searchPlaceholder': 'Search sender, subject, or preview',
    'inbox.receivedAt': 'Received at',
    'inbox.subject': 'Subject',
    'inbox.noSubject': '(no subject)',
    'inbox.sender': 'Sender',
    'inbox.mailbox': 'Mailbox',
    'inbox.read': 'Read',
    'inbox.preview': 'Preview',
    'inbox.localPart': 'Local part',
    'inbox.localPartRequired': 'Enter the local part',
    'inbox.localPartInvalid': 'The local part cannot contain @ or spaces',
    'inbox.domainRequired': 'Select a domain',
    'inbox.displayName': 'Display name',
    'inbox.messageDetail': 'Message detail',
    'inbox.copyRaw': 'Copy raw',
    'inbox.recipients': 'Recipients',
    'inbox.textBody': 'Text body',
    'inbox.htmlBody': 'HTML preview',
    'inbox.htmlSource': 'HTML source',
    'inbox.rawMessage': 'Raw MIME',
    'inbox.noTextBody': 'No text body',
    'inbox.noHtmlBody': 'No HTML body',
    'inbox.noRawMessage': 'No raw MIME',
    'inbox.messageNotFound': 'Message not found or deleted.',
    'inbox.detailLoadFailed': 'Failed to load message detail.',
    'smtp.connectionTitle': 'SMTP connection',
    'smtp.loginCredentialsTitle': 'SMTP credentials',
    'smtp.username': 'Username',
    'smtp.password': 'Password',
    'smtp.usernameRequired': 'Enter SMTP username',
    'smtp.passwordRequired': 'Enter SMTP password',
    'smtp.passwordSet': 'Set',
    'smtp.passwordEmpty': 'Empty',
    'smtp.passwordUnavailable': 'Reset before copying',
    'smtp.create': 'New credential',
    'smtp.createTitle': 'New SMTP credential',
    'smtp.editTitle': 'Edit SMTP credential',
    'smtp.deleteConfirm': 'Delete this SMTP login credential?',
    'smtp.passwordExtra': 'Leave empty to keep the current password. Saved passwords are never shown again.',
    'smtp.regenerate': 'Regenerate password',
    'smtp.resetToCopy': 'Reset before copying',
    'smtpRelay.title': 'Sending relays',
    'smtpRelay.create': 'New relay',
    'smtpRelay.createTitle': 'New outbound SMTP relay',
    'smtpRelay.editTitle': 'Edit outbound SMTP relay',
    'smtpRelay.name': 'Name',
    'smtpRelay.nameRequired': 'Enter the relay name',
    'smtpRelay.server': 'Server',
    'smtpRelay.hostRequired': 'Enter SMTP Host',
    'smtpRelay.portRequired': 'Enter SMTP Port',
    'smtpRelay.username': 'Username',
    'smtpRelay.password': 'Password',
    'smtpRelay.passwordSet': 'Set',
    'smtpRelay.passwordEmpty': 'Empty',
    'smtpRelay.passwordExtra': 'Leave empty to keep the current password. Saved passwords are never shown again.',
    'smtpRelay.generatePassword': 'Generate password',
    'smtpRelay.heloExtra': 'Leave empty to use the system default HELO.',
    'smtpRelay.default': 'Default',
    'smtpRelay.domainDefault': 'Default outbound SMTP relay',
    'smtpRelay.domainDefaultExtra': 'When empty, MailHub uses request relay, user default relay, then system SMTP.',
    'smtpRelay.useResolutionOrder': 'Use default selection order',
    'smtpRelay.deleteConfirm': 'Delete this SMTP relay? Bound domains will fall back to the default selection order.',
    'dnsApi.title': 'DNS integration credentials',
    'dnsApi.createTitle': 'New DNS integration credential',
    'dnsApi.editTitle': 'Edit',
    'dnsApi.zone': 'Zone / root domain',
    'dnsApi.zoneRequired': 'Enter the Zone or root domain',
    'dnsApi.zoneExtra': 'Use any manageable Zone under this account for connection testing. One-click DNS matches the current sending domain automatically.',
    'dnsApi.cloudflareZoneExtra': 'For Cloudflare, use any accessible Zone for testing. One-click DNS matches the current sending domain automatically.',
    'dnsApi.tokenExtra': 'Requires Zone DNS Edit permission.',
    'dnsApi.keepSecret': 'Leave empty to keep the existing secret.',
    'dnsApi.save': 'Save changes',
    'dnsApi.create': 'Create credential',
    'dnsApi.secretHint': 'Secrets are encrypted server-side and never shown in the list.',
    'dnsApi.deleteConfirm': 'Delete this DNS integration credential? This provider will no longer be available for managing the associated zone.',
    'settings.checkItem': 'Check',
    'settings.deliveryChecks': 'Sending Environment Checks',
    'settings.noPermission': 'This account cannot access system settings.',
    'settings.save': 'Save settings',
    'settings.engagementTracking': 'Enable open and click tracking by default',
    'admin.title': 'Admin center',
    'admin.users': 'Users',
    'admin.resources': 'Resources',
    'admin.migration': 'Merge',
    'admin.systemEmail': 'System Email',
    'admin.auditLogs': 'Audit Logs',
    'metrics.accepted': 'Accepted',
    'metrics.failed': 'Failed',
    'metrics.recipients': 'Recipients',
    'metrics.total': 'Total',
    'status.success': 'Passed',
    'status.pending': 'Pending',
    'status.error': 'Misconfigured',
    'status.idle': 'Not configured',
    'tokens.createTitle': 'Create API key',
    'tokens.subtitle': 'Create, update, and revoke scoped tokens for sending and mailbox automation.',
    'tokens.name': 'Name',
    'tokens.namePlaceholder': 'Production API',
    'tokens.nameRequired': 'Enter a key name',
    'tokens.create': 'Create key',
    'tokens.edit': 'Edit key',
    'tokens.editTitle': 'Edit API key',
    'tokens.listTitle': 'API keys',
    'tokens.prefix': 'Token Prefix',
    'tokens.scopes': 'Scopes',
    'tokens.scopesRequired': 'Select at least one scope',
    'tokens.scopesExtra': 'Use send for delivery, mailboxes:read/mailboxes:write for mailbox resources, and messages:read for inbound message content.',
    'tokens.mailboxAccess': 'Message access',
    'tokens.mailboxAccessOwner': 'All mailboxes owned by this account',
    'tokens.mailboxAccessSelected': 'Selected mailboxes',
    'tokens.mailboxAccessAll': 'All system mailboxes (admin)',
    'tokens.mailboxAccessExtra': 'Configured with messages:read and also applied to this token\'s mailbox list. Selected access is bound to mailbox IDs. All-system access is available to administrators only.',
    'tokens.mailboxIds': 'Authorized mailboxes',
    'tokens.mailboxIdsRequired': 'Select at least one mailbox',
    'tokens.mailboxIdsPlaceholder': 'Select mailboxes this token can read',
    'tokens.status': 'Status',
    'tokens.statusActive': 'Active',
    'tokens.statusExpired': 'Expired',
    'tokens.statusRevoked': 'Revoked',
    'tokens.expiresAt': 'Expires at',
    'tokens.expiresAtExtra': 'Leave empty for no expiry. Uses local time.',
    'tokens.fullToken': 'Full Token',
    'tokens.copyFull': 'Copy full token',
    'tokens.copyPrefix': 'Copy prefix',
    'tokens.createdTitle': 'API key created',
    'tokens.createdWarning': 'The full token is stored encrypted and remains copyable from the list or detail view. Keep it only in a trusted server environment.',
    'tokens.createdSuccess': 'API key created',
    'tokens.rotatedTitle': 'API key regenerated',
    'tokens.rotatedSuccess': 'API key regenerated. The previous value stopped working immediately.',
    'tokens.rotatedWarning': 'The previous token stopped working immediately. Update every caller soon; the new full token remains copyable from the list or detail view.',
    'tokens.deletedSuccess': 'API key deleted',
    'tokens.updatedSuccess': 'API key updated',
    'tokens.revokedSuccess': 'API key revoked',
    'tokens.secretAvailable': 'The full token is stored encrypted and can be copied at any time.',
    'tokens.secretUnavailable': 'This legacy token cannot be recovered and is identifiable only by its prefix. Regenerating it immediately invalidates the old value.',
    'tokens.recoverable': 'Copyable',
    'tokens.unrecoverable': 'Not recoverable',
    'tokens.rotate': 'Regenerate',
    'tokens.rotateConfirm': 'Regenerate API key?',
    'tokens.rotateConfirmDescription': 'The previous token will stop working immediately. Every caller still using it will fail. This cannot be undone.',
    'tokens.lastUsed': 'Last used',
    'tokens.neverUsed': 'Never used',
    'tokens.createdAt': 'Created at',
    'tokens.actions': 'Actions',
    'tokens.deleteConfirm': 'Delete this API key?',
    'tokens.revoke': 'Revoke key',
    'tokens.revokeConfirm': 'This API key will stop working immediately. Continue?',
    'tokens.copyCreated': 'Copy full token',
    'tokens.prefixOnlyHelp': 'New tokens are stored encrypted and remain fully copyable. Legacy tokens may retain only a prefix and must be regenerated to become recoverable.',
    'tokens.docsTitle': 'API guide',
    'tokens.endpoint': 'API Endpoint',
    'tokens.mailboxEndpoint': 'Mailbox API Endpoint',
    'tokens.authHeader': 'Authentication',
    'tokens.authHeaderValue': 'Authorization: Bearer <USER_API_TOKEN>',
    'tokens.contentType': 'Content-Type',
    'tokens.requestFields': 'Request fields',
    'tokens.fieldFrom': 'from: sender address. The domain must be added and verified.',
    'tokens.fieldTo': 'to: recipient address. Single email or an array of emails.',
    'tokens.fieldSubject': 'subject: email subject.',
    'tokens.fieldText': 'text: plain text body.',
    'tokens.fieldHtml': 'html: optional HTML body.',
    'tokens.curlExample': 'curl example',
    'tokens.nodeExample': 'Node / Fetch example',
    'tokens.requestExample': 'Request body example',
    'tokens.responseExample': 'Success response example',
    'tokens.sendApi': 'Send API',
    'tokens.mailboxApi': 'Create mailbox API',
    'tokens.mailboxApiHint': 'Use mode=permanent for a persistent mailbox. Use mode=temporary with expiresInMinutes for a temporary mailbox. When address is omitted, the server generates an address and password from domain.',
    'tokens.permanentMailbox': 'Create a persistent mailbox',
    'tokens.temporaryMailbox': 'Create a temporary mailbox',
    'tokens.mailboxResponse': 'Creation result and client configuration',
    'tokens.messagesApi': 'Inbound message API',
    'tokens.messagesApiHint': 'Requires messages:read and is limited by the token message-access setting. Lists support pagination plus mailbox, folder, read-state, and keyword filters.',
    'tokens.messagesList': 'List inbound messages',
    'tokens.messageDetail': 'Read message detail',
    'tokens.mailboxFolders': 'List mailbox folders',
    'tokens.messagesFilters': 'Filters: page/pageSize control pagination; mailboxId limits one mailbox; folder limits one folder; read accepts true/false; q searches sender, recipients, subject, Message ID, and preview.',
    'tokens.messagesAccess': 'Access: account scope covers mailboxes owned by the token owner; selected scope covers only chosen IDs; all-system scope must be explicitly selected by an administrator.',
    'tokens.securityTips': 'Security tips',
    'tokens.securityTipStore': 'Store tokens only on the server side. Do not put them in browser code or public repositories.',
    'tokens.securityTipRotate': 'Use separate tokens per environment. Regenerate immediately after a leak and update every caller.',
    'tokens.securityTipScopes': 'Grant only the scopes your integration needs. Mailbox automation does not need send.',
    'tokens.securityTipDomain': 'The From domain must belong to this account. Verify DNS before production sending.',
    'tokens.noTokenHint': 'Create a token, copy its full secret from the list or detail view, and limit inbound message access to the minimum required scope.',
    'webhooks.title': 'Webhooks',
    'webhooks.subtitle': 'Push delivery updates to your HTTPS endpoint when mail is sent, bounced, or failed.',
    'webhooks.create': 'Create webhook',
    'webhooks.createTitle': 'Create webhook',
    'webhooks.editTitle': 'Edit webhook',
    'webhooks.name': 'Name',
    'webhooks.namePlaceholder': 'Production deliveries',
    'webhooks.nameRequired': 'Enter a webhook name',
    'webhooks.url': 'Callback URL',
    'webhooks.urlPlaceholder': 'https://example.com/webhooks/mailhub',
    'webhooks.urlRequired': 'Enter a callback URL',
    'webhooks.urlHint': 'Use HTTPS in production. Verify requests with the X-MailHub-Signature header.',
    'webhooks.events': 'Events',
    'webhooks.eventsRequired': 'Select at least one event',
    'webhooks.eventSent': 'Sent',
    'webhooks.eventBounced': 'Bounced',
    'webhooks.eventFailed': 'Failed',
    'webhooks.eventOpened': 'Opened',
    'webhooks.eventClicked': 'Clicked',
    'webhooks.eventReceived': 'Received',
    'webhooks.enabled': 'Enabled',
    'webhooks.disabled': 'Disabled',
    'webhooks.scope': 'Scope',
    'webhooks.scopeAccount': 'Account',
    'webhooks.scopeDomain': 'Domain',
    'webhooks.scopeMailbox': 'Mailbox',
    'webhooks.domain': 'Domain',
    'webhooks.domainAccount': 'Entire account',
    'webhooks.domainOverrideHelp': 'If this domain has any enabled endpoint for an event, account-level endpoints for that event are skipped.',
    'webhooks.mailboxReceiptHelp': 'email.received is delivered only after mail is stored in this mailbox. Forward-only mail does not trigger it.',
    'webhooks.secret': 'Signing secret',
    'webhooks.secretPrefix': 'Secret prefix',
    'webhooks.secretCreatedTitle': 'Webhook secret created',
    'webhooks.secretRotatedTitle': 'Webhook secret rotated',
    'webhooks.secretCreatedWarning': 'The full secret is shown only once. Copy it now and store it somewhere secure.',
    'webhooks.copySecret': 'Copy full secret',
    'webhooks.rotateSecret': 'Rotate secret',
    'webhooks.rotateConfirm': 'Rotate this webhook signing secret? The previous secret stops working immediately.',
    'webhooks.test': 'Send test',
    'webhooks.testQueued': 'Test delivery queued',
    'webhooks.deleteConfirm': 'Delete this webhook? Related delivery records will also be removed.',
    'webhooks.empty': 'No webhooks yet. Create one to receive delivery status callbacks.',
    'webhooks.listTitle': 'Endpoints',
    'webhooks.loadFailed': 'Unable to load webhook endpoints',
    'webhooks.recentDeliveriesUnavailable': 'Recent delivery status is temporarily unavailable',
    'webhooks.resourcesUnavailable': 'Domain or mailbox options are temporarily unavailable',
    'webhooks.actions': 'Actions',
    'webhooks.deliveriesTitle': 'Deliveries',
    'webhooks.deliveriesEmpty': 'No deliveries yet',
    'webhooks.deliveriesFilterWebhook': 'Filter by webhook',
    'webhooks.deliveriesFilterStatus': 'Filter by status',
    'webhooks.deliveriesFilterEvent': 'Filter by event',
    'webhooks.allWebhooks': 'All webhooks',
    'webhooks.allStatuses': 'All statuses',
    'webhooks.allEvents': 'All events',
    'webhooks.statusPending': 'Pending',
    'webhooks.statusProcessing': 'Processing',
    'webhooks.statusSuccess': 'Success',
    'webhooks.statusDead': 'Dead',
    'webhooks.attemptCount': 'Attempts',
    'webhooks.responseStatus': 'HTTP status',
    'webhooks.error': 'Error',
    'webhooks.replay': 'Replay',
    'webhooks.replaySuccess': 'Delivery re-queued',
    'webhooks.lastAttemptAt': 'Last attempt',
    'webhooks.nextAttemptAt': 'Next attempt',
    'webhooks.createdAt': 'Created at',
    'webhooks.viewDeliveries': 'View deliveries',
    'webhooks.docsTitle': 'Callback notes',
    'webhooks.docsSignature': 'Verify the body with HMAC-SHA256; the signature is in X-MailHub-Signature.',
    'webhooks.docsEvents': 'Event types: sent, bounced, failed, opened, and clicked. Mailboxes can additionally subscribe to received.',
    'testMail.title': 'Send test email',
    'testMail.fromRequired': 'Enter the sender',
    'testMail.toRequired': 'Enter the recipient',
    'actions.domainCreated': 'Domain created',
    'actions.dnsCheckCompleted': 'DNS check completed',
    'actions.dnsCheckRefreshed': 'DNS check refreshed',
    'actions.dnsApplyCompleted': 'DNS write request completed',
    'actions.dnsApplyPartial': 'DNS write partially failed',
    'actions.domainSaved': 'Domain settings saved',
    'actions.domainDeleted': 'Domain deleted',
    'actions.testMailQueued': 'Submitted to sending queue',
    'actions.dnsApiCreated': 'DNS API created',
    'actions.dnsApiUpdated': 'DNS API updated',
    'actions.dnsApiDeleted': 'DNS API deleted',
    'actions.dnsApiTestCompleted': 'Connection test completed',
    'actions.smtpCreated': 'SMTP login credential created',
    'actions.smtpUpdated': 'SMTP login credential updated',
    'actions.smtpDeleted': 'SMTP login credential deleted',
    'actions.smtpRelayCreated': 'SMTP relay created',
    'actions.smtpRelayUpdated': 'SMTP relay updated',
    'actions.smtpRelayDeleted': 'SMTP relay deleted',
    'actions.inboundMailboxCreated': 'Inbound mailbox created',
    'actions.settingsSaved': 'System settings saved',
    'actions.webhookCreated': 'Webhook created',
    'actions.webhookUpdated': 'Webhook updated',
    'actions.webhookDeleted': 'Webhook deleted',
    'actions.webhookSecretRotated': 'Webhook secret rotated',
    'actions.webhookTestQueued': 'Webhook test queued',
    'actions.webhookDeliveryReplayed': 'Webhook delivery replayed',
    'nav.dashboard': 'Dashboard',
    'nav.overview': 'Overview',
    'nav.activity': 'Sending activity',
    'nav.domains': 'Domains',
    'nav.dnsApi': 'DNS integrations',
    'nav.smtp': 'SMTP & relays',
    'nav.inbox': 'Inbox',
    'nav.tokens': 'API keys',
    'nav.logs': 'Sending Logs',
    'nav.webhooks': 'Webhooks',
    'nav.smtpIntegration': 'SMTP & relays',
    'nav.apiKeys': 'API keys',
    'nav.dnsIntegration': 'DNS integrations',
    'nav.adminCenter': 'Admin center',
    'nav.admin': 'Admin center',
    'nav.settings': 'Settings',
    'nav.group.overview': 'Overview',
    'nav.group.delivery': 'Delivery',
    'nav.group.operations': 'Operations',
    'nav.group.integrations': 'Integrations',
    'nav.group.system': 'System'
  }
};

export function normalizeLocale(locale = DEFAULT_LOCALE) {
  const value = String(locale || '').trim();
  if (supportedLocales.includes(value)) return value;
  const lower = value.toLowerCase();
  if (lower.startsWith('zh')) return 'zh-CN';
  if (lower.startsWith('en')) return 'en-US';
  return DEFAULT_LOCALE;
}

export function createTranslator(locale = DEFAULT_LOCALE) {
  const normalized = normalizeLocale(locale);
  return (key) => messages[normalized]?.[key] || messages[DEFAULT_LOCALE]?.[key] || key;
}

export function getLocaleLabel(locale) {
  return {
    'zh-CN': '简体中文',
    'en-US': 'English'
  }[normalizeLocale(locale)] || String(locale || DEFAULT_LOCALE);
}
