mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 23:47:33 +00:00
translated component
This commit is contained in:
@@ -6,15 +6,12 @@ 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 { 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: "passkey" });
|
|
||||||
|
|
||||||
const { loginName, prompt, organization, requestId, userId } = searchParams;
|
const { loginName, prompt, organization, requestId, userId } = searchParams;
|
||||||
|
|
||||||
@@ -37,7 +34,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="passkey" />
|
||||||
|
</h1>
|
||||||
|
|
||||||
{session && (
|
{session && (
|
||||||
<UserAvatar
|
<UserAvatar
|
||||||
@@ -47,17 +46,19 @@ 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="passkey" />
|
||||||
|
</p>
|
||||||
|
|
||||||
<Alert type={AlertType.INFO}>
|
<Alert type={AlertType.INFO}>
|
||||||
<span>
|
<span>
|
||||||
{t("set.info.description")}
|
<Translated i18nKey="set.info.description" namespace="passkey" />
|
||||||
<a
|
<a
|
||||||
className="text-primary-light-500 dark:text-primary-dark-500 hover:text-primary-light-300 hover:dark:text-primary-dark-300"
|
className="text-primary-light-500 dark:text-primary-dark-500 hover:text-primary-light-300 hover:dark:text-primary-dark-300"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
href="https://zitadel.com/docs/guides/manage/user/reg-create-user#with-passwordless"
|
href="https://zitadel.com/docs/guides/manage/user/reg-create-user#with-passwordless"
|
||||||
>
|
>
|
||||||
{t("set.info.link")}
|
<Translated i18nKey="set.info.link" namespace="passkey" />
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</Alert>
|
</Alert>
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import { DynamicTheme } from "@/components/dynamic-theme";
|
import { DynamicTheme } from "@/components/dynamic-theme";
|
||||||
import { SetRegisterPasswordForm } from "@/components/set-register-password-form";
|
import { SetRegisterPasswordForm } from "@/components/set-register-password-form";
|
||||||
|
import { Translated } from "@/components/translated";
|
||||||
import { getServiceUrlFromHeaders } from "@/lib/service-url";
|
import { getServiceUrlFromHeaders } from "@/lib/service-url";
|
||||||
import {
|
import {
|
||||||
getBrandingSettings,
|
getBrandingSettings,
|
||||||
@@ -9,15 +10,12 @@ import {
|
|||||||
getPasswordComplexitySettings,
|
getPasswordComplexitySettings,
|
||||||
} 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, namespace: "register" });
|
|
||||||
|
|
||||||
let { firstname, lastname, email, organization, requestId } = searchParams;
|
let { firstname, lastname, email, organization, requestId } = searchParams;
|
||||||
|
|
||||||
@@ -57,15 +55,23 @@ export default async function Page(props: {
|
|||||||
return missingData ? (
|
return missingData ? (
|
||||||
<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("missingdata.title")}</h1>
|
<h1>
|
||||||
<p className="ztdl-p">{t("missingdata.description")}</p>
|
<Translated i18nKey="missingdata.title" namespace="register" />
|
||||||
|
</h1>
|
||||||
|
<p className="ztdl-p">
|
||||||
|
<Translated i18nKey="missingdata.description" namespace="register" />
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</DynamicTheme>
|
</DynamicTheme>
|
||||||
) : loginSettings?.allowRegister && loginSettings.allowUsernamePassword ? (
|
) : loginSettings?.allowRegister && loginSettings.allowUsernamePassword ? (
|
||||||
<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("password.title")}</h1>
|
<h1>
|
||||||
<p className="ztdl-p">{t("description")}</p>
|
<Translated i18nKey="password.title" namespace="register" />
|
||||||
|
</h1>
|
||||||
|
<p className="ztdl-p">
|
||||||
|
<Translated i18nKey="description" namespace="register" />
|
||||||
|
</p>
|
||||||
|
|
||||||
{legal && passwordComplexitySettings && (
|
{legal && passwordComplexitySettings && (
|
||||||
<SetRegisterPasswordForm
|
<SetRegisterPasswordForm
|
||||||
@@ -82,8 +88,12 @@ 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>{t("disabled.title")}</h1>
|
<h1>
|
||||||
<p className="ztdl-p">{t("disabled.description")}</p>
|
<Translated i18nKey="disabled.title" namespace="register" />
|
||||||
|
</h1>
|
||||||
|
<p className="ztdl-p">
|
||||||
|
<Translated i18nKey="disabled.description" namespace="register" />
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</DynamicTheme>
|
</DynamicTheme>
|
||||||
);
|
);
|
||||||
|
@@ -3,8 +3,8 @@ import {
|
|||||||
PasskeysType,
|
PasskeysType,
|
||||||
} from "@zitadel/proto/zitadel/settings/v2/login_settings_pb";
|
} from "@zitadel/proto/zitadel/settings/v2/login_settings_pb";
|
||||||
import { AuthenticationMethodType } from "@zitadel/proto/zitadel/user/v2/user_service_pb";
|
import { AuthenticationMethodType } from "@zitadel/proto/zitadel/user/v2/user_service_pb";
|
||||||
import { useTranslations } from "next-intl";
|
|
||||||
import { PASSKEYS, PASSWORD } from "./auth-methods";
|
import { PASSKEYS, PASSWORD } from "./auth-methods";
|
||||||
|
import { Translated } from "./translated";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
authMethods: AuthenticationMethodType[];
|
authMethods: AuthenticationMethodType[];
|
||||||
@@ -17,13 +17,13 @@ export function ChooseAuthenticatorToLogin({
|
|||||||
params,
|
params,
|
||||||
loginSettings,
|
loginSettings,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const t = useTranslations("idp");
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{authMethods.includes(AuthenticationMethodType.PASSWORD) &&
|
{authMethods.includes(AuthenticationMethodType.PASSWORD) &&
|
||||||
loginSettings?.allowUsernamePassword && (
|
loginSettings?.allowUsernamePassword && (
|
||||||
<div className="ztdl-p">Choose an alternative method to login </div>
|
<div className="ztdl-p">
|
||||||
|
<Translated i18nKey="chooseAlternativeMethod" namespace="idp" />
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="grid grid-cols-1 gap-5 w-full pt-4">
|
<div className="grid grid-cols-1 gap-5 w-full pt-4">
|
||||||
{authMethods.includes(AuthenticationMethodType.PASSWORD) &&
|
{authMethods.includes(AuthenticationMethodType.PASSWORD) &&
|
||||||
|
@@ -151,7 +151,7 @@ export function UsernameForm({
|
|||||||
onClick={handleSubmit((e) => submitLoginName(e, organization))}
|
onClick={handleSubmit((e) => submitLoginName(e, organization))}
|
||||||
>
|
>
|
||||||
{loading && <Spinner className="h-5 w-5 mr-2" />}
|
{loading && <Spinner className="h-5 w-5 mr-2" />}
|
||||||
continue
|
<Translated i18nKey="submit" namespace="loginname" />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
Reference in New Issue
Block a user