refactor(i18n): move translations to JSON files under app/locales, dynamic language switch

This commit is contained in:
2026-07-07 09:46:50 +08:00
parent fb98974382
commit 591ad3e178
7 changed files with 565 additions and 285 deletions

249
app/locales/zh.json Normal file
View File

@@ -0,0 +1,249 @@
{
"_meta": {
"name": "中文"
},
"brand": "📮 星笺",
"nav.profiles": "Profile",
"nav.settings": "设置",
"nav.invites": "邀请码管理",
"nav.logout": "退出",
"nav.api_docs": "API 文档",
"login.title": "登录",
"login.username": "用户名",
"login.password": "密码",
"login.remember": "记住我",
"login.no_account": "没有账号?",
"login.go_register": "去注册",
"register.title": "注册",
"register.hint": "邀请码由已有用户或管理员提供",
"register.invite_code": "邀请码",
"register.invite_ph": "8位字母数字",
"register.username": "用户名",
"register.password": "密码",
"register.confirm_password": "确认密码",
"register.has_account": "已有账号?",
"register.go_login": "去登录",
"dash.welcome": "👋 欢迎,",
"dash.total_cards": "全部明信片",
"dash.sent": "已寄出",
"dash.delivered": "已送达",
"dash.received": "已收到",
"dash.countries": "国家/地区",
"dash.chart_sent": "📤 寄出",
"dash.chart_received": "📬 收到",
"dash.recent": "最近动态",
"dash.empty": "暂无明信片",
"dash.welcome_title": "欢迎使用星笺!",
"dash.welcome_hint": "创建一个",
"dash.welcome_hint2": " 开始管理你的明信片",
"dash.today": "今天",
"dash.yesterday": "昨天",
"dash.days_ago": "天前",
"profiles.title": "Profile",
"profiles.new_ph": "新 Profile 昵称",
"profiles.new_btn": "+ 新建",
"profiles.rename": "改名",
"profiles.total": "总计",
"profiles.countries": "国家",
"profiles.notes_ph": "备注(仅自己可见)",
"profiles.save": "保存",
"profiles.created_at": "创建于",
"profiles.view": "查看",
"profiles.delete": "删除",
"profiles.confirm_delete": "确定删除此 Profile",
"pc_list.title": " 的明信片",
"pc_list.new": "+ 新明信片",
"pc_list.duplicate": "编号已存在",
"pc_list.all_countries": "全部国家",
"pc_list.filter": "筛选",
"pc_list.tab_sent": "寄出",
"pc_list.tab_received": "收到",
"pc_list.mark_delivered": "已送达",
"pc_list.confirm_delivered": "确认已送达?",
"pc_list.empty_sent": "没有寄出的明信片。",
"pc_list.empty_received": "没有收到的明信片。",
"pc_detail.title": "明信片详情",
"pc_detail.edit": "编辑",
"pc_detail.mark_delivered": "已送达",
"pc_detail.confirm_delivered": "确认已送达?",
"pc_detail.delete": "删除",
"pc_detail.confirm_delete": "确定删除?",
"pc_detail.front": "正面",
"pc_detail.back": "反面",
"pc_detail.no_front": "📷 未上传正面图片",
"pc_detail.no_back": "📷 未上传反面图片",
"pc_detail.upload_front": "上传正面",
"pc_detail.upload_back": "上传反面",
"pc_detail.card_number": "编号",
"pc_detail.status": "状态",
"pc_detail.recipient": "收件人",
"pc_detail.country": "国家/地区",
"pc_detail.send_time": "寄出时间",
"pc_detail.arrival_time": "到达时间",
"pc_detail.sender": "发件人",
"pc_detail.receive_time": "收到时间",
"pc_detail.profile": "所属 Profile",
"pc_detail.notes": "备注",
"status.sent": "已寄出",
"status.delivered": "已送达",
"status.received": "已收到",
"pc_form.edit": "编辑明信片",
"pc_form.new": "新建明信片",
"pc_form.number": "编号",
"pc_form.number_hint": "格式AB-1234567",
"pc_form.status": "状态",
"pc_form.recipient": "收件人",
"pc_form.country": "国家/地区",
"pc_form.send_time": "寄出时间",
"pc_form.arrival_time": "到达时间",
"pc_form.sender": "发件人",
"pc_form.receive_time": "收到时间",
"pc_form.notes": "备注",
"pc_form.notes_ph": "可选备注信息",
"pc_form.save": "保存",
"pc_form.cancel": "取消",
"settings.title": "用户设置",
"settings.tab_account": "账号",
"settings.tab_showcase": "展示",
"settings.change_username": "修改用户名",
"settings.current_username": "当前用户名",
"settings.new_username": "新用户名",
"settings.change_password": "修改密码",
"settings.current_password": "当前密码",
"settings.new_password": "新密码",
"settings.confirm_password": "确认新密码",
"settings.language": "语言",
"settings.language_zh": "中文",
"settings.language_en": "English",
"settings.showcase_global": "全局展示设置",
"settings.showcase_mode": "展示页面模式",
"settings.mode_profile": "按 Profile 分类",
"settings.mode_flat": "全部合并",
"settings.save_global": "保存全局设置",
"settings.public_url": "公开展示页地址:",
"settings.public_url_label": "公开展示页:",
"settings.profiles_showcase": "各 Profile 展示设置",
"settings.showcase_on": "展示中",
"settings.showcase_off": "未开启",
"settings.enable_showcase": "开启展示",
"settings.showcase_content": "展示内容",
"settings.content_both": "发出 + 收到",
"settings.content_sent": "仅发出",
"settings.content_received": "仅收到",
"settings.save": "保存",
"invites.title": "邀请码管理",
"invites.create": "创建邀请码",
"invites.code_label": "邀请码(留空自动生成)",
"invites.code_ph": "自动生成",
"invites.limit_type": "限制类型",
"invites.unlimited": "无限制",
"invites.uses": "使用次数",
"invites.expires": "有效期",
"invites.times": "次数",
"invites.create_btn": "创建",
"invites.creator": "创建者",
"invites.used": "已用",
"invites.no_expire": "永不过期",
"invites.expires_at": "过期",
"invites.edit": "编辑",
"invites.save": "保存",
"invites.delete": "删除",
"invites.confirm_delete": "确定删除此邀请码?",
"invites.max_uses": "最大使用次数",
"invites.expires_time": "过期时间",
"invites.registered_users": "注册用户",
"invites.empty": "暂无邀请码",
"showcase.title": " 的明信片",
"showcase.empty": "暂无展示内容",
"showcase.tab_sent": "发出",
"showcase.tab_received": "收到",
"showcase_manage.title": "展示管理",
"showcase_manage.global": "全局展示设置",
"showcase_manage.save": "保存全局设置",
"showcase_manage.public_url": "公开展示页地址:",
"showcase_manage.profiles": "各 Profile 展示设置",
"showcase_manage.on": "展示中",
"showcase_manage.off": "未开启",
"showcase_manage.enable": "开启展示",
"showcase_manage.content": "展示内容",
"showcase_manage.both": "发出 + 收到",
"showcase_manage.sent_only": "仅发出",
"showcase_manage.received_only": "仅收到",
"profile_showcase.title": " 展示设置",
"profile_showcase.enable": "开启展示",
"profile_showcase.content": "展示内容",
"profile_showcase.both": "发出 + 收到",
"profile_showcase.sent_only": "仅发出",
"profile_showcase.received_only": "仅收到",
"profile_showcase.single_control": "单张明信片展示控制",
"profile_showcase.hidden": "隐藏",
"profile_showcase.hint": "开启展示后可控制单张明信片的可见性",
"flash.username_taken": "用户名已存在",
"flash.username_ok": "用户名修改成功",
"flash.wrong_password": "当前密码错误",
"flash.password_mismatch": "两次输入的新密码不一致",
"flash.password_short": "新密码长度至少6位",
"flash.password_ok": "密码修改成功",
"settings.tab_apikeys": "API Keys",
"apikey.title": "API Key 管理",
"apikey.hint": "使用 API Key 通过 HTTP 请求访问星笺的公共 API。请妥善保管你的 Key它仅在创建时显示一次。",
"apikey.created": "✅ 新 Key 已创建:",
"apikey.copy_now": "⚠️ 请立即复制保存,关闭后将无法再次查看完整 Key。",
"apikey.name_ph": "Key 名称(可选)",
"apikey.create": "创建 Key",
"apikey.name": "名称",
"apikey.key": "Key",
"apikey.created_at": "创建时间",
"apikey.last_used": "最后使用",
"apikey.delete": "删除",
"apikey.confirm_delete": "确定删除此 API Key",
"apikey.empty": "暂无 API Key",
"api_docs.title": "API 文档",
"api_docs.intro": "星笺提供 RESTful API供第三方应用集成使用。所有需要鉴权的请求需在 Header 中携带 X-API-Key。",
"api_docs.base_url": "基础 URL",
"api_docs.auth": "鉴权方式",
"api_docs.auth_desc": "在请求头中携带你的 API Key",
"api_docs.profile_ops": "Profile 操作",
"api_docs.postcard_ops": "明信片操作",
"api_docs.upload_op": "图片上传",
"api_docs.key_ops": "API Key 管理",
"api_docs.showcase_ops": "公开展示(无需鉴权)",
"api_docs.method": "方法",
"api_docs.path": "路径",
"api_docs.desc": "说明",
"api_docs.params": "参数",
"api_docs.body": "请求体 (JSON)",
"api_docs.response": "响应",
"api_docs.status": "状态码",
"api_docs.go_settings": "去设置页创建 API Key →",
"api_docs.try_it": "试试看",
"api_docs.api_key_ph": "输入你的 API Key",
"api_docs.send": "发送",
"api_docs.response_label": "响应结果",
"api_docs.no_auth": "此接口无需鉴权",
"api_docs.ep.list_profiles": "获取当前用户的所有 Profile 列表。",
"api_docs.ep.create_profile": "创建新 Profile。",
"api_docs.ep.get_profile": "获取单个 Profile 详情。",
"api_docs.ep.update_profile": "更新 Profile。",
"api_docs.ep.delete_profile": "删除 Profile 及其下所有明信片。",
"api_docs.ep.list_postcards": "获取指定 Profile 下的明信片列表。",
"api_docs.ep.create_postcard": "创建新明信片。",
"api_docs.ep.get_postcard": "获取单张明信片详情。",
"api_docs.ep.update_postcard": "更新明信片。仅传入需要修改的字段。",
"api_docs.ep.delete_postcard": "删除单张明信片。",
"api_docs.ep.upload_image": "上传明信片图片(正面或背面),使用",
"api_docs.ep.upload_uses": "上传明信片图片(正面或背面),使用",
"api_docs.ep.list_keys": "获取当前用户的所有 API Key。",
"api_docs.ep.create_key": "创建新的 API Key。创建后完整 Key 仅在响应中显示一次。",
"api_docs.ep.delete_key": "删除指定 API Key。",
"api_docs.ep.showcase_user": "获取用户的公开展示数据。",
"api_docs.ep.showcase_profile": "获取单个 Profile 的展示数据。",
"api_docs.ep.filter_hint": "按状态筛选sent / delivered / received",
"api_docs.ep.optional_str": "string可选",
"api_docs.ep.image_file": "图片文件",
"api_docs.ep.side_hint": "string可选— front 或 back默认 front",
"api_docs.ep.key_name_hint": "string可选— Key 的备注名称",
"api_docs.ep.country_hint": "两个大写字母,如 JP",
"api_docs.ep.date_hint": "格式 YYYY-MM-DD 或 YYYY-MM-DDTHH:MM",
"misc.required": " *"
}