feat: add registration invite code handling and improve error translations

- Updated AuthViews component to conditionally show invite code field based on registrationInviteRequired prop.
- Enhanced error handling in auth API functions to use translateServerError for better user feedback.
- Added new translations for various server error messages in English, Spanish, Russian, Chinese (Simplified and Traditional).
- Modified demo initial bootstrap state to include registrationInviteRequired flag.
- Updated types to include registrationInviteRequired in WebBootstrapResponse.
This commit is contained in:
shuaiplus
2026-05-10 23:07:07 +08:00
parent e0d81f2733
commit 7c58282e42
16 changed files with 258 additions and 45 deletions
+29 -1
View File
@@ -349,6 +349,7 @@ const zhTW: Record<string, string> = {
"txt_create": "創建",
"txt_create_account": "創建賬戶",
"txt_registering": "正在註冊...",
"txt_register_failed": "註冊失敗",
"txt_create_folder": "創建文件夾",
"txt_create_folder_failed": "創建文件夾失敗",
"txt_create_item_failed": "創建項目失敗",
@@ -408,6 +409,7 @@ const zhTW: Record<string, string> = {
"txt_disable_this_send": "禁用此 Send",
"txt_disable_totp": "停用 TOTP",
"txt_disable_totp_failed": "禁用 TOTP 失敗",
"txt_totp_update_failed": "更新 TOTP 失敗",
"txt_download": "下載",
"txt_downloading": "下載中...",
"txt_downloading_percent": "下載中 {percent}%",
@@ -467,12 +469,33 @@ const zhTW: Record<string, string> = {
"txt_identity_details": "身份詳情",
"txt_ie_browser": "IE 瀏覽器",
"txt_create_invite_failed": "創建邀請碼失敗",
"txt_invite_code_optional": "邀請碼(首位註冊者無需填寫,其他人必填)",
"txt_invite_code_required": "邀請碼(必填)",
"txt_invite_created": "邀請碼已創建",
"txt_invite_revoked": "邀請碼已撤銷",
"txt_revoke_invite_failed": "撤銷邀請碼失敗",
"txt_invite_validity_hours": "邀請碼有效期(小時)",
"txt_invites": "邀請碼",
"txt_rate_limit_try_again_seconds": "請求過於頻繁,請在 {seconds} 秒後重試",
"txt_server_error_account_disabled": "帳號已被禁用",
"txt_server_error_client_credentials_incorrect": "客戶端 ID 或客戶端密鑰不正確,請重試",
"txt_server_error_client_ip_required": "無法獲取客戶端 IP",
"txt_server_error_email_already_registered": "該郵箱已註冊",
"txt_server_error_email_password_required": "郵箱和密碼不能為空",
"txt_server_error_email_required": "郵箱不能為空",
"txt_server_error_invalid_refresh_token": "登入狀態已失效,請重新登入",
"txt_server_error_invalid_request_payload": "請求內容無效",
"txt_server_error_invite_invalid_or_expired": "邀請碼無效或已過期",
"txt_server_error_invite_required": "邀請碼不能為空",
"txt_server_error_jwt_secret_default": "JWT_SECRET 正在使用默認示例值,請修改後再繼續",
"txt_server_error_jwt_secret_missing": "JWT_SECRET 未設置",
"txt_server_error_jwt_secret_too_short": "JWT_SECRET 至少需要 32 個字符",
"txt_server_error_parameter_error": "請求參數錯誤",
"txt_server_error_refresh_token_required": "登入狀態缺失,請重新登入",
"txt_server_error_registration_retry": "註冊暫時不可用,請重試一次",
"txt_server_error_totp_token_required": "請輸入兩步驗證碼",
"txt_server_error_two_factor_invalid": "兩步驗證碼無效,請重試",
"txt_server_error_two_factor_required": "需要兩步驗證",
"txt_server_error_username_password_incorrect": "用戶名或密碼不正確,請重試",
"txt_ios": "iOS",
"txt_item": "項目",
"txt_item_created": "項目已創建",
@@ -546,6 +569,7 @@ const zhTW: Record<string, string> = {
"txt_master_password_is_required": "主密碼不能為空",
"txt_master_password_is_required_2": "請輸入主密碼",
"txt_master_password_must_be_at_least_12_chars": "主密碼至少需要 12 個字符",
"txt_master_password_verify_failed": "主密碼驗證失敗",
"txt_master_password_reprompt": "主密碼二次確認",
"txt_master_password_reprompt_2": "主密碼二次確認",
"txt_max_access_count": "最大訪問次數",
@@ -632,6 +656,9 @@ const zhTW: Record<string, string> = {
"txt_api_key_rotated": "API 密鑰已輪換",
"txt_rotate_api_key_confirm": "輪換 API 密鑰?當前密鑰將立即失效。",
"txt_api_key_is_empty": "API 密鑰為空",
"txt_get_api_key_failed": "獲取 API 密鑰失敗",
"txt_get_recovery_code_failed": "獲取恢復代碼失敗",
"txt_rotate_api_key_failed": "輪換 API 密鑰失敗",
"txt_api_key_dialog_intro": "您的 API 密鑰可用於在 Bitwarden CLI 中進行身份驗證。",
"txt_api_key_warning_body": "您的 API 密鑰是一種替代身份驗證機制。請嚴格保密。",
"txt_oauth_client_credentials": "OAuth 2.0 客戶端憑據",
@@ -669,6 +696,7 @@ const zhTW: Record<string, string> = {
"txt_save_profile": "保存資料",
"txt_save_profile_failed": "保存資料失敗",
"txt_search_sends": "搜索 Send...",
"txt_session_refresh_failed": "會話刷新失敗,請重新登入",
"txt_search_your_secure_vault": "搜索你的密碼庫...",
"txt_clear_search": "清空搜索",
"txt_clear_search_esc": "清空搜索(Esc",