From bfb7928b6b24350a904fb6283f2810c1541b758e Mon Sep 17 00:00:00 2001 From: Max Peintner Date: Wed, 25 Jun 2025 08:14:04 +0200 Subject: [PATCH] missing i18n, cleanup --- apps/login/locales/de.json | 7 +++++++ apps/login/locales/es.json | 7 +++++++ apps/login/locales/it.json | 7 +++++++ apps/login/locales/pl.json | 7 +++++++ apps/login/locales/ru.json | 7 +++++++ apps/login/locales/zh.json | 7 +++++++ apps/login/src/app/(login)/idp/ldap/page.tsx | 20 +++++++++---------- .../ldap-username-password-form.tsx | 16 ++++----------- 8 files changed, 55 insertions(+), 23 deletions(-) diff --git a/apps/login/locales/de.json b/apps/login/locales/de.json index ecb4740682..75897a628e 100644 --- a/apps/login/locales/de.json +++ b/apps/login/locales/de.json @@ -80,6 +80,13 @@ "description": "Bitte vervollständige die Registrierung, um dein Konto zu erstellen." } }, + "ldap": { + "title": "LDAP Login", + "description": "Geben Sie Ihre LDAP-Anmeldedaten ein.", + "username": "Benutzername", + "password": "Passwort", + "submit": "Weiter" + }, "mfa": { "verify": { "title": "Bestätigen Sie Ihre Identität", diff --git a/apps/login/locales/es.json b/apps/login/locales/es.json index 40e3392e4a..fe88bb94c6 100644 --- a/apps/login/locales/es.json +++ b/apps/login/locales/es.json @@ -80,6 +80,13 @@ "description": "Para completar el registro, debes establecer una contraseña." } }, + "ldap": { + "title": "Iniciar sesión con LDAP", + "description": "Introduce tus credenciales LDAP.", + "username": "Nombre de usuario", + "password": "Contraseña", + "submit": "Continuar" + }, "mfa": { "verify": { "title": "Verifica tu identidad", diff --git a/apps/login/locales/it.json b/apps/login/locales/it.json index 6f562f0974..1229a1a4c0 100644 --- a/apps/login/locales/it.json +++ b/apps/login/locales/it.json @@ -80,6 +80,13 @@ "description": "Completa la registrazione del tuo account." } }, + "ldap": { + "title": "Accedi con LDAP", + "description": "Inserisci le tue credenziali LDAP.", + "username": "Nome utente", + "password": "Password", + "submit": "Continua" + }, "mfa": { "verify": { "title": "Verifica la tua identità", diff --git a/apps/login/locales/pl.json b/apps/login/locales/pl.json index 58c77b1d09..9fea6a19fa 100644 --- a/apps/login/locales/pl.json +++ b/apps/login/locales/pl.json @@ -80,6 +80,13 @@ "description": "Ukończ rejestrację swojego konta." } }, + "ldap": { + "title": "Zaloguj się przez LDAP", + "description": "Wprowadź swoje dane logowania LDAP.", + "username": "Nazwa użytkownika", + "password": "Hasło", + "submit": "Kontynuuj" + }, "mfa": { "verify": { "title": "Zweryfikuj swoją tożsamość", diff --git a/apps/login/locales/ru.json b/apps/login/locales/ru.json index b73f9b99c6..e745f1ae59 100644 --- a/apps/login/locales/ru.json +++ b/apps/login/locales/ru.json @@ -80,6 +80,13 @@ "description": "Завершите регистрацию вашего аккаунта." } }, + "ldap": { + "title": "Войти через LDAP", + "description": "Введите ваши учетные данные LDAP.", + "username": "Имя пользователя", + "password": "Пароль", + "submit": "Продолжить" + }, "mfa": { "verify": { "title": "Подтвердите вашу личность", diff --git a/apps/login/locales/zh.json b/apps/login/locales/zh.json index 1023660882..5a9cb3a4eb 100644 --- a/apps/login/locales/zh.json +++ b/apps/login/locales/zh.json @@ -80,6 +80,13 @@ "description": "完成您的账户注册。" } }, + "ldap": { + "title": "使用 LDAP 登录", + "description": "请输入您的 LDAP 凭据。", + "username": "用户名", + "password": "密码", + "submit": "继续" + }, "mfa": { "verify": { "title": "验证您的身份", diff --git a/apps/login/src/app/(login)/idp/ldap/page.tsx b/apps/login/src/app/(login)/idp/ldap/page.tsx index 67e6bbe4a7..105c6832e6 100644 --- a/apps/login/src/app/(login)/idp/ldap/page.tsx +++ b/apps/login/src/app/(login)/idp/ldap/page.tsx @@ -1,9 +1,9 @@ import { DynamicTheme } from "@/components/dynamic-theme"; import { LDAPUsernamePasswordForm } from "@/components/ldap-username-password-form"; +import { Translated } from "@/components/translated"; import { getServiceUrlFromHeaders } from "@/lib/service-url"; import { getBrandingSettings, getDefaultOrg } from "@/lib/zitadel"; import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb"; -import { getLocale, getTranslations } from "next-intl/server"; import { headers } from "next/headers"; export default async function Page(props: { @@ -11,9 +11,7 @@ export default async function Page(props: { params: Promise<{ provider: string }>; }) { const searchParams = await props.searchParams; - const locale = getLocale(); - const t = await getTranslations({ locale, namespace: "ldap" }); - const { idpId, requestId, organization, link } = searchParams; + const { idpId, organization, link } = searchParams; if (!idpId) { throw new Error("No idpId provided in searchParams"); @@ -41,14 +39,14 @@ export default async function Page(props: { return (
-

{t("title")}

-

{t("description")}

+

+ +

+

+ +

- +
); diff --git a/apps/login/src/components/ldap-username-password-form.tsx b/apps/login/src/components/ldap-username-password-form.tsx index b3dcaabd58..b7653c5782 100644 --- a/apps/login/src/components/ldap-username-password-form.tsx +++ b/apps/login/src/components/ldap-username-password-form.tsx @@ -1,7 +1,6 @@ "use client"; import { createNewSessionForLDAP } from "@/lib/server/idp"; -import { useTranslations } from "next-intl"; import { useRouter } from "next/navigation"; import { useState } from "react"; import { useForm } from "react-hook-form"; @@ -10,6 +9,7 @@ import { BackButton } from "./back-button"; import { Button, ButtonVariants } from "./button"; import { TextInput } from "./input"; import { Spinner } from "./spinner"; +import { Translated } from "./translated"; type Inputs = { loginName: string; @@ -17,18 +17,10 @@ type Inputs = { }; type Props = { - organization?: string; - requestId?: string; idpId: string; }; -export function LDAPUsernamePasswordForm({ - organization, - requestId, - idpId, -}: Props) { - const t = useTranslations("password"); - +export function LDAPUsernamePasswordForm({ idpId }: Props) { const { register, handleSubmit, formState } = useForm({ mode: "onBlur", }); @@ -72,7 +64,7 @@ export function LDAPUsernamePasswordForm({ type="text" autoComplete="username" {...register("loginName", { required: "This field is required" })} - label={"Loginname"} + label="Loginname" data-testid="username-text-input" /> @@ -104,7 +96,7 @@ export function LDAPUsernamePasswordForm({ data-testid="submit-button" > {loading && } - {t("verify.submit")} +