translated

This commit is contained in:
Max Peintner
2025-06-19 14:52:02 +02:00
parent 996af6eea1
commit cccec6ea1e
2 changed files with 16 additions and 11 deletions

View File

@@ -15,7 +15,6 @@ import {
registerTOTP,
} from "@/lib/zitadel";
import { RegisterTOTPResponse } from "@zitadel/proto/zitadel/user/v2/user_service_pb";
import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers";
import Link from "next/link";
import { redirect } from "next/navigation";
@@ -26,8 +25,6 @@ export default async function Page(props: {
}) {
const params = await props.params;
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "otp" });
const { loginName, organization, sessionId, requestId, checkAfter } =
searchParams;
@@ -128,7 +125,9 @@ export default async function Page(props: {
return (
<DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4">
<h1>{t("set.title")}</h1>
<h1>
<Translated i18nKey="set.title" namespace="otp" />
</h1>
{!session && (
<div className="py-4">
<Alert>
@@ -154,7 +153,12 @@ export default async function Page(props: {
{totpResponse && "uri" in totpResponse && "secret" in totpResponse ? (
<>
<p className="ztdl-p">{t("set.totpRegisterDescription")}</p>
<p className="ztdl-p">
<Translated
i18nKey="set.totpRegisterDescription"
namespace="otp"
/>
</p>
<div>
<TotpRegister
uri={totpResponse.uri as string}
@@ -188,7 +192,7 @@ export default async function Page(props: {
className="self-end"
variant={ButtonVariants.Primary}
>
{t("set.submit")}
<Translated i18nKey="set.submit" namespace="otp" />
</Button>
</Link>
</div>

View File

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