fix(api-docs): replace all hardcoded Chinese with i18n translation keys for English support

This commit is contained in:
2026-07-07 09:33:01 +08:00
parent 5dc705bf37
commit fb98974382
2 changed files with 63 additions and 37 deletions

View File

@@ -251,6 +251,32 @@ _translations: dict[str, dict[str, str]] = {
"api_docs.response_label": {"zh": "响应结果", "en": "Response"},
"api_docs.no_auth": {"zh": "此接口无需鉴权", "en": "No authentication required"},
# ── API Docs (endpoint descriptions) ──
"api_docs.ep.list_profiles": {"zh": "获取当前用户的所有 Profile 列表。", "en": "List all profiles for the current user."},
"api_docs.ep.create_profile": {"zh": "创建新 Profile。", "en": "Create a new profile."},
"api_docs.ep.get_profile": {"zh": "获取单个 Profile 详情。", "en": "Get a single profile by ID."},
"api_docs.ep.update_profile": {"zh": "更新 Profile。", "en": "Update a profile."},
"api_docs.ep.delete_profile": {"zh": "删除 Profile 及其下所有明信片。", "en": "Delete a profile and all its postcards."},
"api_docs.ep.list_postcards": {"zh": "获取指定 Profile 下的明信片列表。", "en": "List postcards under a profile."},
"api_docs.ep.create_postcard": {"zh": "创建新明信片。", "en": "Create a new postcard."},
"api_docs.ep.get_postcard": {"zh": "获取单张明信片详情。", "en": "Get a single postcard by ID."},
"api_docs.ep.update_postcard": {"zh": "更新明信片。仅传入需要修改的字段。", "en": "Update a postcard. Only send fields you want to change."},
"api_docs.ep.delete_postcard": {"zh": "删除单张明信片。", "en": "Delete a single postcard."},
"api_docs.ep.upload_image": {"zh": "上传明信片图片(正面或背面),使用", "en": "Upload a postcard image (front or back), using"},
"api_docs.ep.upload_uses": {"zh": "上传明信片图片(正面或背面),使用", "en": "Upload a postcard image (front or back), using"},
"api_docs.ep.list_keys": {"zh": "获取当前用户的所有 API Key。", "en": "List all API keys for the current user."},
"api_docs.ep.create_key": {"zh": "创建新的 API Key。创建后完整 Key 仅在响应中显示一次。", "en": "Create a new API key. The full key is only shown once in the response."},
"api_docs.ep.delete_key": {"zh": "删除指定 API Key。", "en": "Delete an API key."},
"api_docs.ep.showcase_user": {"zh": "获取用户的公开展示数据。", "en": "Get a user's public showcase data."},
"api_docs.ep.showcase_profile": {"zh": "获取单个 Profile 的展示数据。", "en": "Get showcase data for a single profile."},
"api_docs.ep.filter_hint": {"zh": "按状态筛选sent / delivered / received", "en": "Filter by status: sent / delivered / received"},
"api_docs.ep.optional_str": {"zh": "string可选", "en": "string (optional)"},
"api_docs.ep.image_file": {"zh": "图片文件", "en": "image file"},
"api_docs.ep.side_hint": {"zh": "string可选— front 或 back默认 front", "en": "string (optional) — front or back, defaults to front"},
"api_docs.ep.key_name_hint": {"zh": "string可选— Key 的备注名称", "en": "string (optional) — a label for the key"},
"api_docs.ep.country_hint": {"zh": "两个大写字母,如 JP", "en": "two uppercase letters, e.g. JP"},
"api_docs.ep.date_hint": {"zh": "格式 YYYY-MM-DD 或 YYYY-MM-DDTHH:MM", "en": "format: YYYY-MM-DD or YYYY-MM-DDTHH:MM"},
# ── Misc ──
"misc.required": {"zh": " *", "en": " *"},
}