diff --git a/messages/en.json b/messages/en.json index 41572e1f0..0d56ccfc5 100644 --- a/messages/en.json +++ b/messages/en.json @@ -164,13 +164,20 @@ "noAccount": "Don't have an account? ", "signUp": "Sign up", "signIn": "Sign in", - "orContinueWith": "OR CONTINUE WITH" + "orContinueWith": "OR CONTINUE WITH", + "email": "Email", + "emailPlaceholder": "user@example.com", + "password": "Password" }, "SignUp": { "title": "Create an account", "titleAdmin": "Create an Admin Account", "signIn": "Sign in", "email": "Email", + "emailPlaceholder": "user@example.com", + "name": "Name", + "namePlaceholder": "John Doe", + "password": "Password", "description": "Sign up to your account", "signUpDescription": "Start your journey with us", "signUpDescriptionAdmin": "Welcome first user! You will be the admin of the system.", @@ -180,12 +187,23 @@ "step1": "Start your journey with us by entering your email address", "step2": "I'll use this name when we chat", "step3": "Create a strong password to secure your account", + "stepProgress": "Step {current} of {total}", "signUp": "Sign Up", "invalidEmail": "Invalid email address", "emailAlreadyExists": "Email already exists", "nameRequired": "Name is required", "passwordRequired": "Password is required", - "createAccount": "Create account" + "createAccount": "Create account", + "passwordHintLength": "8-20 characters", + "passwordHintLetter": "At least one letter", + "passwordHintNumber": "At least one number" + }, + "Error": { + "title": "Auth Error", + "signupDisabled": "Signup is disabled", + "unauthorized": "Authentication required", + "unknownError": "Unknown error", + "goToHome": "Go to home" }, "Intro": { "description": "Welcome to better-chatbot. Sign in to experience our AI-powered conversational tools." diff --git a/messages/es.json b/messages/es.json index 7ed719b7b..bb981a533 100644 --- a/messages/es.json +++ b/messages/es.json @@ -51,21 +51,43 @@ "noAccount": "¿No tienes una cuenta?", "signUp": "Registrarse", "signIn": "Iniciar sesión", - "orContinueWith": "O CONTINÚA CON" + "orContinueWith": "O CONTINÚA CON", + "email": "Correo electrónico", + "emailPlaceholder": "usuario@ejemplo.com", + "password": "Contraseña" }, "SignUp": { "title": "Crear una cuenta", + "titleAdmin": "Crear una cuenta de administrador", "signIn": "Iniciar sesión", + "email": "Correo electrónico", + "emailPlaceholder": "usuario@ejemplo.com", + "name": "Nombre", + "namePlaceholder": "Juan Pérez", + "password": "Contraseña", "description": "Regístrate en tu cuenta", + "signUpDescription": "Comienza tu viaje con nosotros", + "signUpDescriptionAdmin": "¡Bienvenido, primer usuario! Serás el administrador del sistema.", "step1": "Comienza tu viaje con nosotros ingresando tu dirección de correo electrónico", "step2": "Usaré este nombre cuando charlemos", "step3": "Crea una contraseña segura para proteger tu cuenta", + "stepProgress": "Paso {current} de {total}", "signUp": "Registrarse", "invalidEmail": "Dirección de correo electrónico inválida", "emailAlreadyExists": "El correo electrónico ya existe", "nameRequired": "El nombre es obligatorio", "passwordRequired": "La contraseña es obligatoria", - "createAccount": "Crear cuenta" + "createAccount": "Crear cuenta", + "passwordHintLength": "8-20 caracteres", + "passwordHintLetter": "Al menos una letra", + "passwordHintNumber": "Al menos un número" + }, + "Error": { + "title": "Error de autenticación", + "signupDisabled": "El registro está deshabilitado", + "unauthorized": "Se requiere autenticación", + "unknownError": "Error desconocido", + "goToHome": "Ir al inicio" }, "Intro": { "description": "Bienvenido a better-chatbot. Inicia sesión para experimentar nuestras herramientas conversacionales impulsadas por IA." diff --git a/messages/fr.json b/messages/fr.json index 109546bf2..8a6f03567 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -51,21 +51,43 @@ "noAccount": "Vous n'avez pas de compte ?", "signUp": "S'inscrire", "signIn": "Se connecter", - "orContinueWith": "OU CONTINUER AVEC" + "orContinueWith": "OU CONTINUER AVEC", + "email": "E-mail", + "emailPlaceholder": "utilisateur@exemple.com", + "password": "Mot de passe" }, "SignUp": { "title": "Créer un compte", + "titleAdmin": "Créer un compte administrateur", "signIn": "Se connecter", + "email": "E-mail", + "emailPlaceholder": "utilisateur@exemple.com", + "name": "Nom", + "namePlaceholder": "Jean Dupont", + "password": "Mot de passe", "description": "Inscrivez-vous à votre compte", + "signUpDescription": "Commencez votre parcours avec nous", + "signUpDescriptionAdmin": "Bienvenue, premier utilisateur ! Vous serez l'administrateur du système.", "step1": "Commencez votre parcours avec nous en saisissant votre adresse e-mail", "step2": "J'utiliserai ce nom quand nous discuterons", "step3": "Créez un mot de passe fort pour sécuriser votre compte", + "stepProgress": "Étape {current} sur {total}", "signUp": "S'inscrire", "invalidEmail": "Adresse e-mail invalide", "emailAlreadyExists": "L'e-mail existe déjà", "nameRequired": "Le nom est requis", "passwordRequired": "Le mot de passe est requis", - "createAccount": "Créer un compte" + "createAccount": "Créer un compte", + "passwordHintLength": "8-20 caractères", + "passwordHintLetter": "Au moins une lettre", + "passwordHintNumber": "Au moins un chiffre" + }, + "Error": { + "title": "Erreur d'authentification", + "signupDisabled": "L'inscription est désactivée", + "unauthorized": "Authentification requise", + "unknownError": "Erreur inconnue", + "goToHome": "Aller à l'accueil" }, "Intro": { "description": "Bienvenue sur better-chatbot. Connectez-vous pour découvrir nos outils de conversation alimentés par l'IA." diff --git a/messages/ja.json b/messages/ja.json index d9bd20ba5..5ccca1ac0 100644 --- a/messages/ja.json +++ b/messages/ja.json @@ -51,21 +51,43 @@ "noAccount": "アカウントをお持ちでない方は", "signUp": "サインアップ", "signIn": "サインイン", - "orContinueWith": "または次で続行" + "orContinueWith": "または次で続行", + "email": "メールアドレス", + "emailPlaceholder": "user@example.com", + "password": "パスワード" }, "SignUp": { "title": "アカウントを作成", + "titleAdmin": "管理者アカウントを作成", "signIn": "サインイン", + "email": "メールアドレス", + "emailPlaceholder": "user@example.com", + "name": "名前", + "namePlaceholder": "山田太郎", + "password": "パスワード", "description": "アカウントにサインアップ", + "signUpDescription": "私たちと一緒に始めましょう", + "signUpDescriptionAdmin": "ようこそ、最初のユーザーです!あなたがシステムの管理者になります。", "step1": "メールアドレスを入力して、私たちとの旅を始めましょう", "step2": "チャット時にこの名前を使用します", "step3": "アカウントを保護するための強力なパスワードを作成してください", + "stepProgress": "ステップ {current} / {total}", "signUp": "サインアップ", "invalidEmail": "無効なメールアドレス", "emailAlreadyExists": "メールアドレスが既に存在します", "nameRequired": "名前が必要です", "passwordRequired": "パスワードが必要です", - "createAccount": "アカウントを作成" + "createAccount": "アカウントを作成", + "passwordHintLength": "8〜20文字", + "passwordHintLetter": "少なくとも1つの英字", + "passwordHintNumber": "少なくとも1つの数字" + }, + "Error": { + "title": "認証エラー", + "signupDisabled": "サインアップは無効です", + "unauthorized": "認証が必要です", + "unknownError": "不明なエラー", + "goToHome": "ホームへ" }, "Intro": { "description": "better-chatbot へようこそ。AIを活用した会話ツールを体験するためにサインインしてください。" diff --git a/messages/ko.json b/messages/ko.json index 6b6553366..9ac4c1256 100644 --- a/messages/ko.json +++ b/messages/ko.json @@ -52,21 +52,43 @@ "noAccount": "계정이 없습니까?", "signUp": "회원가입", "signIn": "로그인", - "orContinueWith": "다른 계정으로 계속하기" + "orContinueWith": "다른 계정으로 계속하기", + "email": "이메일", + "emailPlaceholder": "user@example.com", + "password": "비밀번호" }, "SignUp": { "title": "회원가입", + "titleAdmin": "관리자 계정 생성", "signIn": "로그인", + "email": "이메일", + "emailPlaceholder": "user@example.com", + "name": "이름", + "namePlaceholder": "홍길동", + "password": "비밀번호", "description": "계정에 회원가입하여 계속합니다", + "signUpDescription": "우리와 함께 여정을 시작하세요", + "signUpDescriptionAdmin": "첫 번째 사용자를 환영합니다! 시스템 관리자가 됩니다.", "step1": "우리와 함께 여정을 시작하기 위해 이메일 주소를 입력하세요", "step2": "우리와 대화할 때 이 이름을 사용할 거예요", "step3": "강력한 비밀번호를 만들어 계정을 보호하세요", + "stepProgress": "단계 {current} / {total}", "signUp": "회원가입", "invalidEmail": "이메일 주소가 유효하지 않습니다", "emailAlreadyExists": "이메일이 이미 존재합니다", "nameRequired": "이름이 필요합니다", "passwordRequired": "비밀번호가 필요합니다", - "createAccount": "계정 생성" + "createAccount": "계정 생성", + "passwordHintLength": "8-20자", + "passwordHintLetter": "최소 1개의 문자", + "passwordHintNumber": "최소 1개의 숫자" + }, + "Error": { + "title": "인증 오류", + "signupDisabled": "회원가입이 비활성화되었습니다", + "unauthorized": "인증이 필요합니다", + "unknownError": "알 수 없는 오류", + "goToHome": "홈으로 이동" }, "Intro": { "description": "better-chatbot에 오신 것을 환영합니다. 우리의 AI 기반 대화 도구를 경험하세요." diff --git a/messages/no.json b/messages/no.json index 9dd648566..96e066944 100644 --- a/messages/no.json +++ b/messages/no.json @@ -164,13 +164,20 @@ "noAccount": "Har du ikke en konto? ", "signUp": "Registrer deg", "signIn": "Logg inn", - "orContinueWith": "ELLER FORTSETT MED" + "orContinueWith": "ELLER FORTSETT MED", + "email": "E-post", + "emailPlaceholder": "bruker@eksempel.no", + "password": "Passord" }, "SignUp": { "title": "Opprett en konto", "titleAdmin": "Opprett en administratorkonto", "signIn": "Logg inn", "email": "E-post", + "emailPlaceholder": "bruker@eksempel.no", + "name": "Navn", + "namePlaceholder": "Ola Nordmann", + "password": "Passord", "description": "Registrer deg for kontoen din", "signUpDescription": "Start reisen din med oss", "signUpDescriptionAdmin": "Velkommen, første bruker! Du vil bli administrator for systemet.", @@ -180,12 +187,23 @@ "step1": "Start reisen din med oss ved å skrive inn e-postadressen din", "step2": "Jeg bruker dette navnet når vi chatter", "step3": "Opprett et sterkt passord for å sikre kontoen din", + "stepProgress": "Steg {current} av {total}", "signUp": "Registrer deg", "invalidEmail": "Ugyldig e-postadresse", "emailAlreadyExists": "E-postadressen finnes allerede", "nameRequired": "Navn er påkrevd", "passwordRequired": "Passord er påkrevd", - "createAccount": "Opprett konto" + "createAccount": "Opprett konto", + "passwordHintLength": "8-20 tegn", + "passwordHintLetter": "Minst én bokstav", + "passwordHintNumber": "Minst ett tall" + }, + "Error": { + "title": "Autentiseringsfeil", + "signupDisabled": "Registrering er deaktivert", + "unauthorized": "Autentisering kreves", + "unknownError": "Ukjent feil", + "goToHome": "Gå til forsiden" }, "Intro": { "description": "Velkommen til better-chatbot. Logg inn for å oppleve våre AI-drevne samtaleverktøy." diff --git a/messages/zh.json b/messages/zh.json index 670a5970b..4b4ea9c69 100644 --- a/messages/zh.json +++ b/messages/zh.json @@ -52,21 +52,43 @@ "noAccount": "没有账户?", "signUp": "注册", "signIn": "登录", - "orContinueWith": "或继续使用" + "orContinueWith": "或继续使用", + "email": "邮箱", + "emailPlaceholder": "user@example.com", + "password": "密码" }, "SignUp": { "title": "创建账户", + "titleAdmin": "创建管理员账户", "signIn": "登录", + "email": "邮箱", + "emailPlaceholder": "user@example.com", + "name": "姓名", + "namePlaceholder": "张三", + "password": "密码", "description": "注册您的账户", + "signUpDescription": "与我们一起开始您的旅程", + "signUpDescriptionAdmin": "欢迎,第一位用户!您将成为系统管理员。", "step1": "通过输入您的邮箱地址开始您的旅程", "step2": "我会在聊天时使用这个名字", "step3": "创建一个强密码来保护您的账户", + "stepProgress": "第 {current} 步,共 {total} 步", "signUp": "注册", "invalidEmail": "无效的邮箱地址", "emailAlreadyExists": "邮箱已存在", "nameRequired": "姓名是必需的", "passwordRequired": "密码是必需的", - "createAccount": "创建账户" + "createAccount": "创建账户", + "passwordHintLength": "8-20个字符", + "passwordHintLetter": "至少一个字母", + "passwordHintNumber": "至少一个数字" + }, + "Error": { + "title": "认证错误", + "signupDisabled": "注册已禁用", + "unauthorized": "需要认证", + "unknownError": "未知错误", + "goToHome": "返回首页" }, "Intro": { "description": "欢迎来到 MCP 聊天机器人。登录以体验我们的 AI 驱动的对话工具。" diff --git a/src/app/api/auth/error/page.tsx b/src/app/api/auth/error/page.tsx index 34aee22dc..4e4c5b092 100644 --- a/src/app/api/auth/error/page.tsx +++ b/src/app/api/auth/error/page.tsx @@ -7,17 +7,7 @@ import { CardTitle, } from "ui/card"; import LightRays from "ui/light-rays"; - -const convertErrorToMessage = (error: string) => { - switch (error) { - case "signup_disabled": - return "Signup is disabled"; - case "UNAUTHORIZED": - return "Authentication required"; - default: - return error; - } -}; +import { getTranslations } from "next-intl/server"; export default async function ErrorPage({ searchParams, @@ -25,6 +15,18 @@ export default async function ErrorPage({ searchParams: Promise<{ error?: string }>; }) { const { error } = await searchParams; + const t = await getTranslations("Auth.Error"); + + const convertErrorToMessage = (error: string) => { + switch (error) { + case "signup_disabled": + return t("signupDisabled"); + case "UNAUTHORIZED": + return t("unauthorized"); + default: + return error; + } + }; return (
@@ -33,9 +35,11 @@ export default async function ErrorPage({
- Auth Error + + {t("title")} + - {convertErrorToMessage(error ?? "Unknown error")} + {convertErrorToMessage(error ?? t("unknownError"))} @@ -43,7 +47,7 @@ export default async function ErrorPage({ className="text-sm text-muted-foreground text-center underline" href="/" > - Go to home + {t("goToHome")} diff --git a/src/components/auth/email-sign-up.tsx b/src/components/auth/email-sign-up.tsx index f705a1fbe..d252c65a0 100644 --- a/src/components/auth/email-sign-up.tsx +++ b/src/components/auth/email-sign-up.tsx @@ -121,7 +121,10 @@ export default function EmailSignUp({

- Step {step} of {steps.length} + {t("Auth.SignUp.stepProgress", { + current: step, + total: steps.length, + })}

{step === 1 && (
- + - +
- +
- 8-20 characters + {t("Auth.SignUp.passwordHintLength")}
@@ -236,7 +239,7 @@ export default function EmailSignUp({ : "text-muted-foreground" } > - At least one letter + {t("Auth.SignUp.passwordHintLetter")}
@@ -252,7 +255,7 @@ export default function EmailSignUp({ : "text-muted-foreground" } > - At least one number + {t("Auth.SignUp.passwordHintNumber")}
diff --git a/src/components/auth/sign-in.tsx b/src/components/auth/sign-in.tsx index ad811cf13..9464c070c 100644 --- a/src/components/auth/sign-in.tsx +++ b/src/components/auth/sign-in.tsx @@ -84,7 +84,7 @@ export default function SignIn({ {emailAndPasswordEnabled && !isFirstUser && (
- + setFormData({ email: e.target.value })} type="email" - placeholder="user@example.com" + placeholder={t("emailPlaceholder")} required />
- +