translated

This commit is contained in:
Max Peintner
2025-06-20 09:10:05 +02:00
parent f2420ce5c6
commit f092894f1b
13 changed files with 122 additions and 73 deletions

View File

@@ -1,5 +1,6 @@
import { ConsentScreen } from "@/components/consent"; import { ConsentScreen } from "@/components/consent";
import { DynamicTheme } from "@/components/dynamic-theme"; import { DynamicTheme } from "@/components/dynamic-theme";
import { Translated } from "@/components/translated";
import { getServiceUrlFromHeaders } from "@/lib/service-url"; import { getServiceUrlFromHeaders } from "@/lib/service-url";
import { import {
getBrandingSettings, getBrandingSettings,
@@ -7,22 +8,23 @@ import {
getDeviceAuthorizationRequest, getDeviceAuthorizationRequest,
} from "@/lib/zitadel"; } from "@/lib/zitadel";
import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb"; import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb";
import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
export default async function Page(props: { export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>; searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) { }) {
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale });
const userCode = searchParams?.user_code; const userCode = searchParams?.user_code;
const requestId = searchParams?.requestId; const requestId = searchParams?.requestId;
const organization = searchParams?.organization; const organization = searchParams?.organization;
if (!userCode || !requestId) { if (!userCode || !requestId) {
return <div>{t("error.noUserCode")}</div>; return (
<div>
<Translated i18nKey="noUserCode" namespace="error" />
</div>
);
} }
const _headers = await headers(); const _headers = await headers();
@@ -34,7 +36,11 @@ export default async function Page(props: {
}); });
if (!deviceAuthorizationRequest) { if (!deviceAuthorizationRequest) {
return <div>{t("error.noDeviceRequest")}</div>; return (
<div>
<Translated i18nKey="noDeviceRequest" namespace="error" />
</div>
);
} }
let defaultOrganization; let defaultOrganization;
@@ -66,15 +72,19 @@ export default async function Page(props: {
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1> <h1>
{t("device.request.title", { <Translated
appName: deviceAuthorizationRequest?.appName, i18nKey="request.title"
})} namespace="device"
data={{ appName: deviceAuthorizationRequest?.appName }}
/>
</h1> </h1>
<p className="ztdl-p"> <p className="ztdl-p">
{t("device.request.description", { <Translated
appName: deviceAuthorizationRequest?.appName, i18nKey="request.description"
})} namespace="device"
data={{ appName: deviceAuthorizationRequest?.appName }}
/>
</p> </p>
<ConsentScreen <ConsentScreen

View File

@@ -1,17 +1,15 @@
import { DeviceCodeForm } from "@/components/device-code-form"; import { DeviceCodeForm } from "@/components/device-code-form";
import { DynamicTheme } from "@/components/dynamic-theme"; import { DynamicTheme } from "@/components/dynamic-theme";
import { Translated } from "@/components/translated";
import { getServiceUrlFromHeaders } from "@/lib/service-url"; import { getServiceUrlFromHeaders } from "@/lib/service-url";
import { getBrandingSettings, getDefaultOrg } from "@/lib/zitadel"; import { getBrandingSettings, getDefaultOrg } from "@/lib/zitadel";
import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb"; import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb";
import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
export default async function Page(props: { export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>; searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) { }) {
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "device" });
const userCode = searchParams?.user_code; const userCode = searchParams?.user_code;
const organization = searchParams?.organization; const organization = searchParams?.organization;
@@ -37,8 +35,12 @@ export default async function Page(props: {
return ( return (
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1>{t("usercode.title")}</h1> <h1>
<p className="ztdl-p">{t("usercode.description")}</p> <Translated i18nKey="usercode.title" namespace="device" />
</h1>
<p className="ztdl-p">
<Translated i18nKey="usercode.description" namespace="device" />
</p>
<DeviceCodeForm userCode={userCode}></DeviceCodeForm> <DeviceCodeForm userCode={userCode}></DeviceCodeForm>
</div> </div>
</DynamicTheme> </DynamicTheme>

View File

@@ -1,6 +1,7 @@
import { Alert, AlertType } from "@/components/alert"; import { Alert, AlertType } from "@/components/alert";
import { ChooseAuthenticatorToLogin } from "@/components/choose-authenticator-to-login"; import { ChooseAuthenticatorToLogin } from "@/components/choose-authenticator-to-login";
import { DynamicTheme } from "@/components/dynamic-theme"; import { DynamicTheme } from "@/components/dynamic-theme";
import { Translated } from "@/components/translated";
import { UserAvatar } from "@/components/user-avatar"; import { UserAvatar } from "@/components/user-avatar";
import { getServiceUrlFromHeaders } from "@/lib/service-url"; import { getServiceUrlFromHeaders } from "@/lib/service-url";
import { import {
@@ -11,7 +12,6 @@ import {
} from "@/lib/zitadel"; } from "@/lib/zitadel";
import { HumanUser, User } from "@zitadel/proto/zitadel/user/v2/user_pb"; import { HumanUser, User } from "@zitadel/proto/zitadel/user/v2/user_pb";
import { AuthenticationMethodType } from "@zitadel/proto/zitadel/user/v2/user_service_pb"; import { AuthenticationMethodType } from "@zitadel/proto/zitadel/user/v2/user_service_pb";
import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
export default async function Page(props: { export default async function Page(props: {
@@ -19,8 +19,6 @@ export default async function Page(props: {
params: Promise<{ provider: string }>; params: Promise<{ provider: string }>;
}) { }) {
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "idp" });
const { organization, userId } = searchParams; const { organization, userId } = searchParams;
@@ -77,8 +75,12 @@ export default async function Page(props: {
return ( return (
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1>{t("loginError.title")}</h1> <h1>
<Alert type={AlertType.ALERT}>{t("loginError.description")}</Alert> <Translated i18nKey="loginError.title" namespace="idp" />
</h1>
<Alert type={AlertType.ALERT}>
<Translated i18nKey="loginError.description" namespace="idp" />
</Alert>
{userId && authMethods.length && ( {userId && authMethods.length && (
<> <>

View File

@@ -5,6 +5,7 @@ import { linkingFailed } from "@/components/idps/pages/linking-failed";
import { linkingSuccess } from "@/components/idps/pages/linking-success"; import { linkingSuccess } from "@/components/idps/pages/linking-success";
import { loginFailed } from "@/components/idps/pages/login-failed"; import { loginFailed } from "@/components/idps/pages/login-failed";
import { loginSuccess } from "@/components/idps/pages/login-success"; import { loginSuccess } from "@/components/idps/pages/login-success";
import { Translated } from "@/components/translated";
import { getServiceUrlFromHeaders } from "@/lib/service-url"; import { getServiceUrlFromHeaders } from "@/lib/service-url";
import { import {
addHuman, addHuman,
@@ -27,7 +28,6 @@ import {
AddHumanUserRequestSchema, AddHumanUserRequestSchema,
UpdateHumanUserRequestSchema, UpdateHumanUserRequestSchema,
} from "@zitadel/proto/zitadel/user/v2/user_service_pb"; } from "@zitadel/proto/zitadel/user/v2/user_service_pb";
import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
const ORG_SUFFIX_REGEX = /(?<=@)(.+)/; const ORG_SUFFIX_REGEX = /(?<=@)(.+)/;
@@ -73,8 +73,6 @@ export default async function Page(props: {
}) { }) {
const params = await props.params; const params = await props.params;
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "idp" });
let { id, token, requestId, organization, link } = searchParams; let { id, token, requestId, organization, link } = searchParams;
const { provider } = params; const { provider } = params;
@@ -321,8 +319,12 @@ export default async function Page(props: {
return ( return (
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1>{t("registerSuccess.title")}</h1> <h1>
<p className="ztdl-p">{t("registerSuccess.description")}</p> <Translated i18nKey="registerSuccess.title" namespace="idp" />
</h1>
<p className="ztdl-p">
<Translated i18nKey="registerSuccess.description" namespace="idp" />
</p>
<IdpSignin <IdpSignin
userId={newUser.userId} userId={newUser.userId}
idpIntent={{ idpIntentId: id, idpIntentToken: token }} idpIntent={{ idpIntentId: id, idpIntentToken: token }}

View File

@@ -1,14 +1,12 @@
import { DynamicTheme } from "@/components/dynamic-theme"; import { DynamicTheme } from "@/components/dynamic-theme";
import { Translated } from "@/components/translated";
import { getServiceUrlFromHeaders } from "@/lib/service-url"; import { getServiceUrlFromHeaders } from "@/lib/service-url";
import { getBrandingSettings, getDefaultOrg } from "@/lib/zitadel"; import { getBrandingSettings, getDefaultOrg } from "@/lib/zitadel";
import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb"; import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb";
import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
export default async function Page(props: { searchParams: Promise<any> }) { export default async function Page(props: { searchParams: Promise<any> }) {
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "logout" });
const _headers = await headers(); const _headers = await headers();
const { serviceUrl } = getServiceUrlFromHeaders(_headers); const { serviceUrl } = getServiceUrlFromHeaders(_headers);
@@ -33,8 +31,12 @@ export default async function Page(props: { searchParams: Promise<any> }) {
return ( return (
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1>{t("success.title")}</h1> <h1>
<p className="ztdl-p mb-6 block">{t("success.description")}</p> <Translated i18nKey="success.title" namespace="logout" />
</h1>
<p className="ztdl-p mb-6 block">
<Translated i18nKey="success.description" namespace="logout" />
</p>
</div> </div>
</DynamicTheme> </DynamicTheme>
); );

View File

@@ -12,15 +12,12 @@ import {
getSession, getSession,
listAuthenticationMethodTypes, listAuthenticationMethodTypes,
} from "@/lib/zitadel"; } from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
export default async function Page(props: { export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>; searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) { }) {
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "mfa" });
const { loginName, requestId, organization, sessionId } = searchParams; const { loginName, requestId, organization, sessionId } = searchParams;
@@ -90,9 +87,13 @@ export default async function Page(props: {
return ( return (
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1>{t("verify.title")}</h1> <h1>
<Translated i18nKey="verify.title" namespace="mfa" />
</h1>
<p className="ztdl-p">{t("verify.description")}</p> <p className="ztdl-p">
<Translated i18nKey="verify.description" namespace="mfa" />
</p>
{sessionFactors && ( {sessionFactors && (
<UserAvatar <UserAvatar
@@ -118,7 +119,9 @@ export default async function Page(props: {
userMethods={sessionFactors.authMethods ?? []} userMethods={sessionFactors.authMethods ?? []}
></ChooseSecondFactor> ></ChooseSecondFactor>
) : ( ) : (
<Alert>{t("verify.noResults")}</Alert> <Alert>
<Translated i18nKey="verify.noResults" namespace="mfa" />
</Alert>
)} )}
<div className="mt-8 flex w-full flex-row items-center"> <div className="mt-8 flex w-full flex-row items-center">

View File

@@ -16,7 +16,6 @@ import {
} from "@/lib/zitadel"; } from "@/lib/zitadel";
import { Timestamp, timestampDate } from "@zitadel/client"; import { Timestamp, timestampDate } from "@zitadel/client";
import { Session } from "@zitadel/proto/zitadel/session/v2/session_pb"; import { Session } from "@zitadel/proto/zitadel/session/v2/session_pb";
import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
function isSessionValid(session: Partial<Session>): { function isSessionValid(session: Partial<Session>): {
@@ -39,8 +38,6 @@ export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>; searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) { }) {
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "mfa" });
const { loginName, checkAfter, force, requestId, organization, sessionId } = const { loginName, checkAfter, force, requestId, organization, sessionId } =
searchParams; searchParams;
@@ -119,9 +116,13 @@ export default async function Page(props: {
return ( return (
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1>{t("set.title")}</h1> <h1>
<Translated i18nKey="set.title" namespace="mfa" />
</h1>
<p className="ztdl-p">{t("set.description")}</p> <p className="ztdl-p">
<Translated i18nKey="set.description" namespace="mfa" />
</p>
{sessionWithData && ( {sessionWithData && (
<UserAvatar <UserAvatar

View File

@@ -10,7 +10,6 @@ import {
getLoginSettings, getLoginSettings,
getPasswordComplexitySettings, getPasswordComplexitySettings,
} from "@/lib/zitadel"; } from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
export default async function Page(props: { export default async function Page(props: {
@@ -20,8 +19,6 @@ export default async function Page(props: {
const { serviceUrl } = getServiceUrlFromHeaders(_headers); const { serviceUrl } = getServiceUrlFromHeaders(_headers);
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "password" });
const { loginName, organization, requestId } = searchParams; const { loginName, organization, requestId } = searchParams;
@@ -53,9 +50,13 @@ export default async function Page(props: {
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1> <h1>
{sessionFactors?.factors?.user?.displayName ?? t("change.title")} {sessionFactors?.factors?.user?.displayName ?? (
<Translated i18nKey="change.title" namespace="password" />
)}
</h1> </h1>
<p className="ztdl-p mb-6 block">{t("change.description")}</p> <p className="ztdl-p mb-6 block">
<Translated i18nKey="change.description" namespace="u2f" />
</p>
{/* show error only if usernames should be shown to be unknown */} {/* show error only if usernames should be shown to be unknown */}
{(!sessionFactors || !loginName) && {(!sessionFactors || !loginName) &&

View File

@@ -13,7 +13,7 @@ import {
} from "@/lib/zitadel"; } from "@/lib/zitadel";
import { Session } from "@zitadel/proto/zitadel/session/v2/session_pb"; import { Session } from "@zitadel/proto/zitadel/session/v2/session_pb";
import { HumanUser, User } from "@zitadel/proto/zitadel/user/v2/user_pb"; import { HumanUser, User } from "@zitadel/proto/zitadel/user/v2/user_pb";
import { getLocale, getTranslations } from "next-intl/server"; import { getLocale } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
export default async function Page(props: { export default async function Page(props: {
@@ -21,7 +21,6 @@ export default async function Page(props: {
}) { }) {
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale(); const locale = getLocale();
const t = await getTranslations({ locale, namespace: "password" });
const { userId, loginName, organization, requestId, code, initial } = const { userId, loginName, organization, requestId, code, initial } =
searchParams; searchParams;
@@ -73,8 +72,14 @@ export default async function Page(props: {
return ( return (
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1>{session?.factors?.user?.displayName ?? t("set.title")}</h1> <h1>
<p className="ztdl-p mb-6 block">{t("set.description")}</p> {session?.factors?.user?.displayName ?? (
<Translated i18nKey="set.title" namespace="password" />
)}
</h1>
<p className="ztdl-p mb-6 block">
<Translated i18nKey="set.description" namespace="password" />
</p>
{/* show error only if usernames should be shown to be unknown */} {/* show error only if usernames should be shown to be unknown */}
{loginName && !session && !loginSettings?.ignoreUnknownUsernames && ( {loginName && !session && !loginSettings?.ignoreUnknownUsernames && (
@@ -101,7 +106,11 @@ export default async function Page(props: {
></UserAvatar> ></UserAvatar>
) : null} ) : null}
{!initial && <Alert type={AlertType.INFO}>{t("set.codeSent")}</Alert>} {!initial && (
<Alert type={AlertType.INFO}>
<Translated i18nKey="set.codeSent" namespace="password" />
</Alert>
)}
{passwordComplexity && {passwordComplexity &&
(loginName ?? user?.preferredLoginName) && (loginName ?? user?.preferredLoginName) &&

View File

@@ -1,6 +1,7 @@
import { Alert, AlertType } from "@/components/alert"; import { Alert, AlertType } from "@/components/alert";
import { Button, ButtonVariants } from "@/components/button"; import { Button, ButtonVariants } from "@/components/button";
import { DynamicTheme } from "@/components/dynamic-theme"; import { DynamicTheme } from "@/components/dynamic-theme";
import { Translated } from "@/components/translated";
import { UserAvatar } from "@/components/user-avatar"; import { UserAvatar } from "@/components/user-avatar";
import { import {
getMostRecentCookieWithLoginname, getMostRecentCookieWithLoginname,
@@ -14,7 +15,6 @@ import {
getLoginSettings, getLoginSettings,
getSession, getSession,
} from "@/lib/zitadel"; } from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
import Link from "next/link"; import Link from "next/link";
@@ -37,8 +37,6 @@ async function loadSessionById(
export default async function Page(props: { searchParams: Promise<any> }) { export default async function Page(props: { searchParams: Promise<any> }) {
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "signedin" });
const _headers = await headers(); const _headers = await headers();
const { serviceUrl } = getServiceUrlFromHeaders(_headers); const { serviceUrl } = getServiceUrlFromHeaders(_headers);
@@ -66,8 +64,12 @@ export default async function Page(props: { searchParams: Promise<any> }) {
return ( return (
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1>{t("error.title")}</h1> <h1>
<p className="ztdl-p mb-6 block">{t("error.description")}</p> <Translated i18nKey="error.title" namespace="signedin" />
</h1>
<p className="ztdl-p mb-6 block">
<Translated i18nKey="error.description" namespace="signedin" />
</p>
<Alert>{err.message}</Alert> <Alert>{err.message}</Alert>
</div> </div>
</DynamicTheme> </DynamicTheme>
@@ -94,9 +96,15 @@ export default async function Page(props: { searchParams: Promise<any> }) {
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1> <h1>
{t("title", { user: sessionFactors?.factors?.user?.displayName })} <Translated
i18nKey="title"
namespace="signedin"
data={{ user: sessionFactors?.factors?.user?.displayName }}
/>
</h1> </h1>
<p className="ztdl-p mb-6 block">{t("description")}</p> <p className="ztdl-p mb-6 block">
<Translated i18nKey="description" namespace="signedin" />
</p>
<UserAvatar <UserAvatar
loginName={loginName ?? sessionFactors?.factors?.user?.loginName} loginName={loginName ?? sessionFactors?.factors?.user?.loginName}
@@ -122,7 +130,7 @@ export default async function Page(props: { searchParams: Promise<any> }) {
className="self-end" className="self-end"
variant={ButtonVariants.Primary} variant={ButtonVariants.Primary}
> >
{t("continue")} <Translated i18nKey="continue" namespace="signedin" />
</Button> </Button>
</Link> </Link>
</div> </div>

View File

@@ -7,7 +7,7 @@ import { getSessionCookieById } from "@/lib/cookies";
import { getServiceUrlFromHeaders } from "@/lib/service-url"; import { getServiceUrlFromHeaders } from "@/lib/service-url";
import { loadMostRecentSession } from "@/lib/session"; import { loadMostRecentSession } from "@/lib/session";
import { getBrandingSettings, getSession } from "@/lib/zitadel"; import { getBrandingSettings, getSession } from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server"; import { getLocale } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
export default async function Page(props: { export default async function Page(props: {
@@ -15,7 +15,6 @@ export default async function Page(props: {
}) { }) {
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale(); const locale = getLocale();
const t = await getTranslations({ locale, namespace: "u2f" });
const { loginName, requestId, sessionId, organization } = searchParams; const { loginName, requestId, sessionId, organization } = searchParams;
@@ -59,7 +58,9 @@ export default async function Page(props: {
return ( return (
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1>{t("verify.title")}</h1> <h1>
<Translated i18nKey="verify.title" namespace="u2f" />
</h1>
{sessionFactors && ( {sessionFactors && (
<UserAvatar <UserAvatar
@@ -69,7 +70,9 @@ export default async function Page(props: {
searchParams={searchParams} searchParams={searchParams}
></UserAvatar> ></UserAvatar>
)} )}
<p className="ztdl-p mb-6 block">{t("verify.description")}</p> <p className="ztdl-p mb-6 block">
<Translated i18nKey="verify.description" namespace="u2f" />
</p>
{!(loginName || sessionId) && ( {!(loginName || sessionId) && (
<Alert> <Alert>

View File

@@ -6,7 +6,7 @@ import { UserAvatar } from "@/components/user-avatar";
import { getServiceUrlFromHeaders } from "@/lib/service-url"; import { getServiceUrlFromHeaders } from "@/lib/service-url";
import { loadMostRecentSession } from "@/lib/session"; import { loadMostRecentSession } from "@/lib/session";
import { getBrandingSettings } from "@/lib/zitadel"; import { getBrandingSettings } from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server"; import { getLocale } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
export default async function Page(props: { export default async function Page(props: {
@@ -14,7 +14,6 @@ export default async function Page(props: {
}) { }) {
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale(); const locale = getLocale();
const t = await getTranslations({ locale, namespace: "u2f" });
const { loginName, organization, requestId, checkAfter } = searchParams; const { loginName, organization, requestId, checkAfter } = searchParams;
@@ -37,7 +36,9 @@ export default async function Page(props: {
return ( return (
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1>{t("set.title")}</h1> <h1>
<Translated i18nKey="set.title" namespace="u2f" />
</h1>
{sessionFactors && ( {sessionFactors && (
<UserAvatar <UserAvatar
@@ -47,7 +48,10 @@ export default async function Page(props: {
searchParams={searchParams} searchParams={searchParams}
></UserAvatar> ></UserAvatar>
)} )}
<p className="ztdl-p mb-6 block">{t("set.description")}</p> <p className="ztdl-p mb-6 block">
{" "}
<Translated i18nKey="set.description" namespace="u2f" />
</p>
{!sessionFactors && ( {!sessionFactors && (
<div className="py-4"> <div className="py-4">

View File

@@ -1,4 +1,5 @@
import { DynamicTheme } from "@/components/dynamic-theme"; import { DynamicTheme } from "@/components/dynamic-theme";
import { Translated } from "@/components/translated";
import { UserAvatar } from "@/components/user-avatar"; import { UserAvatar } from "@/components/user-avatar";
import { getServiceUrlFromHeaders } from "@/lib/service-url"; import { getServiceUrlFromHeaders } from "@/lib/service-url";
import { loadMostRecentSession } from "@/lib/session"; import { loadMostRecentSession } from "@/lib/session";
@@ -8,13 +9,10 @@ import {
getUserByID, getUserByID,
} from "@/lib/zitadel"; } from "@/lib/zitadel";
import { HumanUser, User } from "@zitadel/proto/zitadel/user/v2/user_pb"; import { HumanUser, User } from "@zitadel/proto/zitadel/user/v2/user_pb";
import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers"; import { headers } from "next/headers";
export default async function Page(props: { searchParams: Promise<any> }) { export default async function Page(props: { searchParams: Promise<any> }) {
const searchParams = await props.searchParams; const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "verify" });
const _headers = await headers(); const _headers = await headers();
const { serviceUrl } = getServiceUrlFromHeaders(_headers); const { serviceUrl } = getServiceUrlFromHeaders(_headers);
@@ -65,8 +63,12 @@ export default async function Page(props: { searchParams: Promise<any> }) {
return ( return (
<DynamicTheme branding={branding}> <DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4"> <div className="flex flex-col items-center space-y-4">
<h1>{t("successTitle")}</h1> <h1>
<p className="ztdl-p mb-6 block">{t("successDescription")}</p> <Translated i18nKey="successTitle" namespace="verify" />
</h1>
<p className="ztdl-p mb-6 block">
<Translated i18nKey="successDescription" namespace="verify" />
</p>
{sessionFactors ? ( {sessionFactors ? (
<UserAvatar <UserAvatar