Commit df5ba9fa by QuentinHsu Committed by GitHub

fix(auth): align password validation copy (#5759)

* fix(i18n): add missing frontend translations

- add missing locale entries for API key loading, channel model empty states, auth, playground, and model configuration copy.
- correct inaccurate Russian and Vietnamese model empty-state translations to avoid fallback or misleading copy.

* fix(auth): align password validation copy

- remove the login password length gate so existing shorter passwords are not blocked before reaching the server.
- reuse distinct minimum-length and 8-20 character messages based on the actual validation rule.
- drop unused duplicate password locale keys and align the user creation placeholder with the 8-20 character constraint.

* fix(i18n): add auth validation message translations

- cover schema-driven auth form errors that are translated through FormMessage.
- keep password, username, confirmation, and OTP validation messages available in every locale.
parent 966af88e
......@@ -24,10 +24,7 @@ import { z } from 'zod'
export const loginFormSchema = z.object({
username: z.string().min(1, 'Please enter your username or email'),
password: z
.string()
.min(1, 'Please enter your password')
.min(8, 'Password must be at least 8 characters long'),
password: z.string().min(1, 'Please enter your password'),
})
export const registerFormSchema = z
......@@ -37,7 +34,7 @@ export const registerFormSchema = z
password: z
.string()
.min(1, 'Please enter your password')
.min(8, 'Password must be at least 8 characters long')
.min(8, 'Password must be between 8 and 20 characters')
.max(20, 'Password must be at most 20 characters long'),
confirmPassword: z.string().min(1, 'Please confirm your password'),
})
......
......@@ -221,9 +221,9 @@ export function SetupWizard() {
if (!password || password.length < 8) {
form.setError('password', {
type: 'manual',
message: t('Password must be at least 8 characters long'),
message: t('Password must be at least 8 characters'),
})
toast.error(t('Password must be at least 8 characters long'))
toast.error(t('Password must be at least 8 characters'))
return false
}
......
......@@ -336,7 +336,7 @@ export function UsersMutateDrawer({
placeholder={
isUpdate
? t('Leave empty to keep unchanged')
: t('Enter password (min 8 characters)')
: t('Enter password (8-20 characters)')
}
/>
</FormControl>
......
......@@ -1609,7 +1609,6 @@
"Enter only a top-level callback domain, for example https://api.example.com, without any path.": "Enter only a top-level callback domain, for example https://api.example.com, without any path.",
"Enter password": "Enter password",
"Enter password (8-20 characters)": "Enter password (8-20 characters)",
"Enter password (min 8 characters)": "Enter password (min 8 characters)",
"Enter quota in {{currency}}": "Enter quota in {{currency}}",
"Enter quota in tokens": "Enter quota in tokens",
"Enter secret key": "Enter secret key",
......@@ -3123,12 +3122,13 @@
"Password has been copied to clipboard": "Password has been copied to clipboard",
"Password Login": "Password Login",
"Password must be at least 8 characters": "Password must be at least 8 characters",
"Password must be at least 8 characters long": "Password must be at least 8 characters long",
"Password must be at most 20 characters long": "Password must be at most 20 characters long",
"Password must be between 8 and 20 characters": "Password must be between 8 and 20 characters",
"Password Registration": "Password Registration",
"Password reset and copied to clipboard: {{password}}": "Password reset and copied to clipboard: {{password}}",
"Password reset: {{password}}": "Password reset: {{password}}",
"Passwords do not match": "Passwords do not match",
"Passwords don't match.": "Passwords don't match.",
"Path": "Path",
"Path not set": "Path not set",
"Path Regex (one per line)": "Path Regex (one per line)",
......@@ -3219,8 +3219,10 @@
"Please agree to the legal terms first": "Please agree to the legal terms first",
"Please complete the security check to continue.": "Please complete the security check to continue.",
"Please confirm that you understand the consequences": "Please confirm that you understand the consequences",
"Please confirm your password": "Please confirm your password",
"Please enable io.net model deployment service and configure an API key in System Settings.": "Please enable io.net model deployment service and configure an API key in System Settings.",
"Please enable Two-factor Authentication or Passkey before proceeding": "Please enable Two-factor Authentication or Passkey before proceeding",
"Please enter a code.": "Please enter a code.",
"Please enter a name": "Please enter a name",
"Please enter a new password": "Please enter a new password",
"Please enter a redemption code": "Please enter a redemption code",
......@@ -3242,6 +3244,9 @@
"Please enter your current password": "Please enter your current password",
"Please enter your email": "Please enter your email",
"Please enter your email first": "Please enter your email first",
"Please enter your password": "Please enter your password",
"Please enter your username": "Please enter your username",
"Please enter your username or email": "Please enter your username or email",
"Please enter your verification code": "Please enter your verification code",
"Please enter your verification code or backup code": "Please enter your verification code or backup code",
"Please fix JSON errors before saving": "Please fix JSON errors before saving",
......
......@@ -1609,7 +1609,6 @@
"Enter only a top-level callback domain, for example https://api.example.com, without any path.": "Saisissez uniquement le domaine de callback principal, par exemple https://api.example.com, sans chemin.",
"Enter password": "Saisir le mot de passe",
"Enter password (8-20 characters)": "Saisir le mot de passe (8-20 caractères)",
"Enter password (min 8 characters)": "Entrez le mot de passe (min. 8 caractères)",
"Enter quota in {{currency}}": "Saisir le quota en {{currency}}",
"Enter quota in tokens": "Saisir le quota en tokens",
"Enter secret key": "Saisir la clé secrète",
......@@ -3123,12 +3122,13 @@
"Password has been copied to clipboard": "Le mot de passe a été copié dans le presse-papiers",
"Password Login": "Connexion par mot de passe",
"Password must be at least 8 characters": "Le mot de passe doit comporter au moins 8 caractères",
"Password must be at least 8 characters long": "Le mot de passe doit comporter au moins 8 caractères",
"Password must be at most 20 characters long": "Le mot de passe doit comporter au maximum 20 caractères",
"Password must be between 8 and 20 characters": "Le mot de passe doit comporter entre 8 et 20 caractères",
"Password Registration": "Inscription par mot de passe",
"Password reset and copied to clipboard: {{password}}": "Mot de passe réinitialisé et copié dans le presse-papiers : {{password}}",
"Password reset: {{password}}": "Mot de passe réinitialisé : {{password}}",
"Passwords do not match": "Les mots de passe ne correspondent pas",
"Passwords don't match.": "Les mots de passe ne correspondent pas.",
"Path": "Chemin",
"Path not set": "Chemin non défini",
"Path Regex (one per line)": "Regex du chemin (un par ligne)",
......@@ -3219,8 +3219,10 @@
"Please agree to the legal terms first": "Veuillez accepter les conditions légales d'abord",
"Please complete the security check to continue.": "Veuillez compléter la vérification de sécurité pour continuer.",
"Please confirm that you understand the consequences": "Veuillez confirmer que vous comprenez les conséquences",
"Please confirm your password": "Veuillez confirmer votre mot de passe",
"Please enable io.net model deployment service and configure an API key in System Settings.": "Veuillez activer le service de déploiement de modèles io.net et configurer une clé API dans les Paramètres système.",
"Please enable Two-factor Authentication or Passkey before proceeding": "Veuillez activer l'authentification à deux facteurs ou une Passkey avant de continuer",
"Please enter a code.": "Veuillez saisir un code.",
"Please enter a name": "Veuillez saisir un nom",
"Please enter a new password": "Veuillez saisir un nouveau mot de passe",
"Please enter a redemption code": "Veuillez saisir un code de rédemption",
......@@ -3242,6 +3244,9 @@
"Please enter your current password": "Veuillez saisir votre mot de passe actuel",
"Please enter your email": "Veuillez saisir votre adresse e-mail",
"Please enter your email first": "Veuillez saisir votre email en premier",
"Please enter your password": "Veuillez saisir votre mot de passe",
"Please enter your username": "Veuillez saisir votre nom d’utilisateur",
"Please enter your username or email": "Veuillez saisir votre nom d’utilisateur ou votre adresse e-mail",
"Please enter your verification code": "Veuillez saisir votre code de vérification",
"Please enter your verification code or backup code": "Veuillez saisir votre code de vérification ou votre code de secours",
"Please fix JSON errors before saving": "Veuillez corriger les erreurs JSON avant d’enregistrer",
......
......@@ -1609,7 +1609,6 @@
"Enter only a top-level callback domain, for example https://api.example.com, without any path.": "コールバックのトップレベルドメインのみを入力してください。例: https://api.example.com。パスは含めないでください。",
"Enter password": "パスワードを入力",
"Enter password (8-20 characters)": "パスワードを入力 (8~20文字)",
"Enter password (min 8 characters)": "パスワードを入力(最小8文字)",
"Enter quota in {{currency}}": "{{currency}} でクォータを入力",
"Enter quota in tokens": "トークン単位でクォータを入力",
"Enter secret key": "シークレットキーを入力",
......@@ -3123,12 +3122,13 @@
"Password has been copied to clipboard": "パスワードがクリップボードにコピーされました",
"Password Login": "パスワードログイン",
"Password must be at least 8 characters": "パスワードは少なくとも8文字である必要があります",
"Password must be at least 8 characters long": "パスワードは8文字以上である必要があります",
"Password must be at most 20 characters long": "パスワードは20文字以内で入力してください",
"Password must be between 8 and 20 characters": "パスワードは8文字以上20文字以下である必要があります",
"Password Registration": "パスワード登録",
"Password reset and copied to clipboard: {{password}}": "パスワードがリセットされ、クリップボードにコピーされました:{{password}}",
"Password reset: {{password}}": "パスワードがリセットされました:{{password}}",
"Passwords do not match": "パスワードが一致しません",
"Passwords don't match.": "パスワードが一致しません。",
"Path": "パス",
"Path not set": "パス未設定",
"Path Regex (one per line)": "パス正規表現(1行に1つ)",
......@@ -3219,8 +3219,10 @@
"Please agree to the legal terms first": "先に利用規約に同意してください",
"Please complete the security check to continue.": "続行するにはセキュリティチェックを完了してください。",
"Please confirm that you understand the consequences": "結果を理解したことを確認してください",
"Please confirm your password": "パスワードを確認してください",
"Please enable io.net model deployment service and configure an API key in System Settings.": "システム設定で io.net モデルデプロイサービスを有効にし、API キーを設定してください。",
"Please enable Two-factor Authentication or Passkey before proceeding": "続行する前に、二要素認証またはパスキーを有効にしてください",
"Please enter a code.": "コードを入力してください。",
"Please enter a name": "名前を入力してください",
"Please enter a new password": "新しいパスワードを入力してください",
"Please enter a redemption code": "引き換えコードを入力してください",
......@@ -3242,6 +3244,9 @@
"Please enter your current password": "現在のパスワードを入力してください",
"Please enter your email": "メールアドレスを入力してください",
"Please enter your email first": "まずメールアドレスを入力してください",
"Please enter your password": "パスワードを入力してください",
"Please enter your username": "ユーザー名を入力してください",
"Please enter your username or email": "ユーザー名またはメールアドレスを入力してください",
"Please enter your verification code": "認証コードを入力してください",
"Please enter your verification code or backup code": "認証コードまたはバックアップコードを入力してください",
"Please fix JSON errors before saving": "保存する前に JSON エラーを直してください",
......
......@@ -1609,7 +1609,6 @@
"Enter only a top-level callback domain, for example https://api.example.com, without any path.": "Введите только домен верхнего уровня для callback, например https://api.example.com, без пути.",
"Enter password": "Введите пароль",
"Enter password (8-20 characters)": "Введите пароль (8-20 символов)",
"Enter password (min 8 characters)": "Введите пароль (минимум 8 символов)",
"Enter quota in {{currency}}": "Введите квоту в {{currency}}",
"Enter quota in tokens": "Введите квоту в токенах",
"Enter secret key": "Введите секретный ключ",
......@@ -2804,7 +2803,7 @@
"No models fetched yet.": "Модели еще не получены.",
"No models found": "Модели не найдены",
"No Models Found": "Модели не найдены",
"No models found.": "Модели автомобиля не найдены.",
"No models found.": "Модели не найдены.",
"No models match the selected filters": "Нет моделей, соответствующих фильтрам",
"No models match your current filters.": "Модели, соответствующие вашим текущим фильтрам, не найдены.",
"No models match your search": "Модели не найдены",
......@@ -3123,12 +3122,13 @@
"Password has been copied to clipboard": "Пароль скопирован в буфер обмена",
"Password Login": "Вход по паролю",
"Password must be at least 8 characters": "Пароль должен содержать не менее 8 символов",
"Password must be at least 8 characters long": "Пароль должен содержать не менее 8 символов",
"Password must be at most 20 characters long": "Пароль должен содержать не более 20 символов",
"Password must be between 8 and 20 characters": "Пароль должен содержать от 8 до 20 символов",
"Password Registration": "Регистрация пароля",
"Password reset and copied to clipboard: {{password}}": "Пароль сброшен и скопирован в буфер обмена: {{password}}",
"Password reset: {{password}}": "Пароль сброшен: {{password}}",
"Passwords do not match": "Пароли не совпадают",
"Passwords don't match.": "Пароли не совпадают.",
"Path": "Путь",
"Path not set": "Путь не задан",
"Path Regex (one per line)": "Регулярное выражение пути (по одному на строку)",
......@@ -3219,8 +3219,10 @@
"Please agree to the legal terms first": "Сначала согласитесь с юридическими условиями",
"Please complete the security check to continue.": "Пожалуйста, завершите проверку безопасности, чтобы продолжить.",
"Please confirm that you understand the consequences": "Пожалуйста, подтвердите, что понимаете последствия",
"Please confirm your password": "Пожалуйста, подтвердите пароль",
"Please enable io.net model deployment service and configure an API key in System Settings.": "Пожалуйста, включите сервис развертывания моделей io.net и настройте API-ключ в системных настройках.",
"Please enable Two-factor Authentication or Passkey before proceeding": "Пожалуйста, включите двухфакторную аутентификацию или Passkey перед продолжением",
"Please enter a code.": "Пожалуйста, введите код.",
"Please enter a name": "Пожалуйста, введите имя",
"Please enter a new password": "Пожалуйста, введите новый пароль",
"Please enter a redemption code": "Пожалуйста, введите код активации",
......@@ -3242,6 +3244,9 @@
"Please enter your current password": "Пожалуйста, введите текущий пароль",
"Please enter your email": "Введите адрес электронной почты",
"Please enter your email first": "Пожалуйста, сначала введите ваш email",
"Please enter your password": "Пожалуйста, введите пароль",
"Please enter your username": "Пожалуйста, введите имя пользователя",
"Please enter your username or email": "Пожалуйста, введите имя пользователя или адрес электронной почты",
"Please enter your verification code": "Пожалуйста, введите код подтверждения",
"Please enter your verification code or backup code": "Пожалуйста, введите код подтверждения или резервный код",
"Please fix JSON errors before saving": "Исправьте ошибки JSON перед сохранением",
......
......@@ -1609,7 +1609,6 @@
"Enter only a top-level callback domain, for example https://api.example.com, without any path.": "Chỉ nhập tên miền callback cấp cao nhất, ví dụ https://api.example.com, không kèm đường dẫn.",
"Enter password": "Nhập mật khẩu",
"Enter password (8-20 characters)": "Nhập mật khẩu (8-20 ký tự)",
"Enter password (min 8 characters)": "Nhập mật khẩu (tối thiểu 8 ký tự)",
"Enter quota in {{currency}}": "Nhập hạn mức bằng {{currency}}",
"Enter quota in tokens": "Nhập hạn mức bằng token",
"Enter secret key": "Nhập khóa bí mật",
......@@ -2803,7 +2802,7 @@
"No models fetched from upstream": "Không lấy được mô hình nào từ upstream",
"No models fetched yet.": "Chưa có mô hình nào được tìm nạp.",
"No models found": "Không tìm thấy mô hình nào",
"No Models Found": "No models found",
"No Models Found": "Không tìm thấy mô hình nào",
"No models found.": "Không tìm thấy mô hình.",
"No models match the selected filters": "Không có mô hình phù hợp bộ lọc",
"No models match your current filters.": "Không có mô hình nào khớp với bộ lọc hiện tại của bạn.",
......@@ -3123,12 +3122,13 @@
"Password has been copied to clipboard": "Mật khẩu đã được sao chép vào bộ nhớ tạm",
"Password Login": "Đăng nhập bằng mật khẩu",
"Password must be at least 8 characters": "Mật khẩu phải có ít nhất 8 ký tự",
"Password must be at least 8 characters long": "Mật khẩu phải có ít nhất 8 ký tự",
"Password must be at most 20 characters long": "Mật khẩu tối đa 20 ký tự",
"Password must be between 8 and 20 characters": "Mật khẩu phải từ 8 đến 20 ký tự",
"Password Registration": "Đăng ký mật khẩu",
"Password reset and copied to clipboard: {{password}}": "Mật khẩu đã đặt lại và sao chép vào clipboard: {{password}}",
"Password reset: {{password}}": "Mật khẩu đã đặt lại: {{password}}",
"Passwords do not match": "Mật khẩu không khớp",
"Passwords don't match.": "Mật khẩu không khớp.",
"Path": "Đường dẫn",
"Path not set": "Chưa đặt đường dẫn",
"Path Regex (one per line)": "Regex đường dẫn (mỗi dòng một mục)",
......@@ -3219,8 +3219,10 @@
"Please agree to the legal terms first": "Vui lòng đồng ý với các điều khoản pháp lý trước",
"Please complete the security check to continue.": "Vui lòng hoàn thành kiểm tra bảo mật để tiếp tục.",
"Please confirm that you understand the consequences": "Vui lòng xác nhận rằng bạn hiểu hậu quả",
"Please confirm your password": "Vui lòng xác nhận mật khẩu",
"Please enable io.net model deployment service and configure an API key in System Settings.": "Vui lòng bật dịch vụ triển khai mô hình io.net và cấu hình khóa API trong Cài đặt hệ thống.",
"Please enable Two-factor Authentication or Passkey before proceeding": "Vui lòng bật Xác thực hai yếu tố hoặc Passkey trước khi tiếp tục",
"Please enter a code.": "Vui lòng nhập mã.",
"Please enter a name": "Vui lòng nhập tên",
"Please enter a new password": "Vui lòng nhập mật khẩu mới",
"Please enter a redemption code": "Vui lòng nhập mã đổi thưởng",
......@@ -3242,6 +3244,9 @@
"Please enter your current password": "Vui lòng nhập mật khẩu hiện tại của bạn",
"Please enter your email": "Vui lòng nhập email của bạn",
"Please enter your email first": "Vui lòng nhập email trước",
"Please enter your password": "Vui lòng nhập mật khẩu",
"Please enter your username": "Vui lòng nhập tên người dùng",
"Please enter your username or email": "Vui lòng nhập tên người dùng hoặc email",
"Please enter your verification code": "Vui lòng nhập mã xác thực của bạn",
"Please enter your verification code or backup code": "Vui lòng nhập mã xác thực hoặc mã dự phòng của bạn",
"Please fix JSON errors before saving": "Vui lòng sửa lỗi JSON trước khi lưu",
......
......@@ -1609,7 +1609,6 @@
"Enter only a top-level callback domain, for example https://api.example.com, without any path.": "只填写回调顶级域名,例如 https://api.example.com,不要带任何路径。",
"Enter password": "输入密码",
"Enter password (8-20 characters)": "输入密码(8-20 个字符)",
"Enter password (min 8 characters)": "请输入密码(至少 8 个字符)",
"Enter quota in {{currency}}": "输入 {{currency}} 额度",
"Enter quota in tokens": "输入令牌配额",
"Enter secret key": "输入密钥",
......@@ -3123,12 +3122,13 @@
"Password has been copied to clipboard": "密码已复制到剪贴板",
"Password Login": "密码登录",
"Password must be at least 8 characters": "密码必须至少 8 个字符",
"Password must be at least 8 characters long": "密码必须至少 8 个字符长",
"Password must be at most 20 characters long": "密码最多 20 个字符",
"Password must be between 8 and 20 characters": "密码长度必须在 8 到 20 个字符之间",
"Password Registration": "密码注册",
"Password reset and copied to clipboard: {{password}}": "密码已重置并复制到剪贴板:{{password}}",
"Password reset: {{password}}": "密码已重置:{{password}}",
"Passwords do not match": "密码不匹配",
"Passwords don't match.": "两次输入的密码不一致。",
"Path": "路径",
"Path not set": "未设置路径",
"Path Regex (one per line)": "路径正则(每行一个)",
......@@ -3219,8 +3219,10 @@
"Please agree to the legal terms first": "请先同意法律条款",
"Please complete the security check to continue.": "请完成安全验证以继续。",
"Please confirm that you understand the consequences": "请确认您了解后果",
"Please confirm your password": "请确认密码",
"Please enable io.net model deployment service and configure an API key in System Settings.": "请先在系统设置中启用 io.net 模型部署服务,并配置 API Key。",
"Please enable Two-factor Authentication or Passkey before proceeding": "请先启用双因素认证或通行密钥",
"Please enter a code.": "请输入验证码。",
"Please enter a name": "请输入名称",
"Please enter a new password": "请输入新密码",
"Please enter a redemption code": "请输入兑换码",
......@@ -3242,6 +3244,9 @@
"Please enter your current password": "请输入当前密码",
"Please enter your email": "请输入您的电子邮件",
"Please enter your email first": "请先输入您的邮箱",
"Please enter your password": "请输入密码",
"Please enter your username": "请输入用户名",
"Please enter your username or email": "请输入用户名或邮箱",
"Please enter your verification code": "请输入您的验证码",
"Please enter your verification code or backup code": "请输入您的验证码或备用码",
"Please fix JSON errors before saving": "请先修复 JSON 错误再保存",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment