|
@@ -40,12 +40,14 @@ ERRORS_EN = {
|
|
|
"反馈不存在": "Feedback not found",
|
|
"反馈不存在": "Feedback not found",
|
|
|
"发送太频繁,请稍后再试": "Sending too frequently — please try again later",
|
|
"发送太频繁,请稍后再试": "Sending too frequently — please try again later",
|
|
|
"密码至少 6 位": "Password must be at least 6 characters",
|
|
"密码至少 6 位": "Password must be at least 6 characters",
|
|
|
|
|
+ "密码需至少 8 位且包含字母和数字": "Password must be at least 8 characters with letters and digits",
|
|
|
"工厂账号不存在": "Factory account not found",
|
|
"工厂账号不存在": "Factory account not found",
|
|
|
"工厂账号专用接口": "Factory-account-only endpoint",
|
|
"工厂账号专用接口": "Factory-account-only endpoint",
|
|
|
"已支付订单请联系客服处理": "Paid order — please contact support",
|
|
"已支付订单请联系客服处理": "Paid order — please contact support",
|
|
|
"当前状态不可取消": "Cannot cancel in the current status",
|
|
"当前状态不可取消": "Cannot cancel in the current status",
|
|
|
"支付状态不合法": "Invalid payment status",
|
|
"支付状态不合法": "Invalid payment status",
|
|
|
"无权查看该订单": "You are not allowed to view this order",
|
|
"无权查看该订单": "You are not allowed to view this order",
|
|
|
|
|
+ "旧密码不正确": "Current password is incorrect",
|
|
|
"模型名过长": "Model name too long",
|
|
"模型名过长": "Model name too long",
|
|
|
"状态不合法": "Invalid status",
|
|
"状态不合法": "Invalid status",
|
|
|
"生产图纸生成失败": "Production drawing generation failed",
|
|
"生产图纸生成失败": "Production drawing generation failed",
|
|
@@ -68,7 +70,10 @@ ERRORS_EN = {
|
|
|
"该订单尚未进入生产流程": "This order has not entered production yet",
|
|
"该订单尚未进入生产流程": "This order has not entered production yet",
|
|
|
"该订单没有刀版数据": "This order has no dieline data",
|
|
"该订单没有刀版数据": "This order has no dieline data",
|
|
|
"该订单没有设计数据": "This order has no design data",
|
|
"该订单没有设计数据": "This order has no design data",
|
|
|
|
|
+ "该账号未设置密码,请使用验证码登录": "No password set for this account — sign in with the code",
|
|
|
|
|
+ "该邮箱已被其他账号绑定": "This email is already linked to another account",
|
|
|
"请先登录": "Please sign in first",
|
|
"请先登录": "Please sign in first",
|
|
|
|
|
+ "请先绑定邮箱后继续使用": "Please bind your email to continue",
|
|
|
"请填写反馈内容": "Please fill in the feedback",
|
|
"请填写反馈内容": "Please fill in the feedback",
|
|
|
"请填写回复内容": "Please fill in the reply",
|
|
"请填写回复内容": "Please fill in the reply",
|
|
|
"请填写快递公司和运单号": "Please enter the carrier and tracking number",
|
|
"请填写快递公司和运单号": "Please enter the carrier and tracking number",
|
|
@@ -77,12 +82,15 @@ ERRORS_EN = {
|
|
|
"请填写邮件主题与内容": "Please enter the email subject and body",
|
|
"请填写邮件主题与内容": "Please enter the email subject and body",
|
|
|
"请描述你的排版需求": "Describe your layout needs",
|
|
"请描述你的排版需求": "Describe your layout needs",
|
|
|
"请输入正确的手机号": "Enter a valid phone number",
|
|
"请输入正确的手机号": "Enter a valid phone number",
|
|
|
|
|
+ "请输入正确的邮箱地址": "Enter a valid email address",
|
|
|
"请输入消息": "Please enter a message",
|
|
"请输入消息": "Please enter a message",
|
|
|
"账号不存在": "Account not found",
|
|
"账号不存在": "Account not found",
|
|
|
"账号已被禁用": "Account disabled",
|
|
"账号已被禁用": "Account disabled",
|
|
|
"账号已被禁用,请联系客服": "Account disabled — please contact support",
|
|
"账号已被禁用,请联系客服": "Account disabled — please contact support",
|
|
|
"需要工作人员权限": "Staff permission required",
|
|
"需要工作人员权限": "Staff permission required",
|
|
|
"需要管理员权限": "Admin permission required",
|
|
"需要管理员权限": "Admin permission required",
|
|
|
|
|
+ "邮件发送失败,请稍后再试": "Failed to send email — try again later",
|
|
|
|
|
+ "邮箱或密码错误": "Wrong email or password",
|
|
|
"预览图不存在": "Preview image not found",
|
|
"预览图不存在": "Preview image not found",
|
|
|
"额度需在 0-100000 之间": "Quota must be between 0 and 100000",
|
|
"额度需在 0-100000 之间": "Quota must be between 0 and 100000",
|
|
|
"验证码错误或已过期": "Incorrect or expired verification code",
|
|
"验证码错误或已过期": "Incorrect or expired verification code",
|
|
@@ -116,6 +124,12 @@ def translate_json_body(body: bytes, lang: str) -> bytes:
|
|
|
return body
|
|
return body
|
|
|
changed = False
|
|
changed = False
|
|
|
if isinstance(data, dict):
|
|
if isinstance(data, dict):
|
|
|
|
|
+ d = data.get("detail")
|
|
|
|
|
+ if isinstance(d, dict) and isinstance(d.get("message"), str):
|
|
|
|
|
+ t = translate_detail(d["message"])
|
|
|
|
|
+ if t != d["message"]:
|
|
|
|
|
+ d["message"] = t
|
|
|
|
|
+ changed = True
|
|
|
for key in ("detail", "message", "msg", "error"):
|
|
for key in ("detail", "message", "msg", "error"):
|
|
|
v = data.get(key)
|
|
v = data.get(key)
|
|
|
if isinstance(v, str):
|
|
if isinstance(v, str):
|