mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 08:27:32 +00:00
data prop for i18n
This commit is contained in:
@@ -74,7 +74,11 @@ export function ConsentScreen({
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p className="ztdl-p text-xs text-left">
|
<p className="ztdl-p text-xs text-left">
|
||||||
{t("device.request.disclaimer", { appName: appName })}
|
<Translated
|
||||||
|
i18nKey="request.disclaimer"
|
||||||
|
namespace="device"
|
||||||
|
data={{ appName: appName }}
|
||||||
|
/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{error && (
|
{error && (
|
||||||
|
@@ -71,10 +71,13 @@ export function SessionClearItem({
|
|||||||
</span>
|
</span>
|
||||||
{valid ? (
|
{valid ? (
|
||||||
<span className="text-xs opacity-80 text-ellipsis">
|
<span className="text-xs opacity-80 text-ellipsis">
|
||||||
{verifiedAt &&
|
{verifiedAt && (
|
||||||
t("verfiedAt", {
|
<Translated
|
||||||
time: moment(timestampDate(verifiedAt)).fromNow(),
|
i18nKey="verfiedAt"
|
||||||
})}
|
namespace="logout"
|
||||||
|
data={{ time: moment(timestampDate(verifiedAt)).fromNow() }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
verifiedAt && (
|
verifiedAt && (
|
||||||
|
@@ -4,18 +4,20 @@ export function Translated({
|
|||||||
i18nKey,
|
i18nKey,
|
||||||
children,
|
children,
|
||||||
namespace,
|
namespace,
|
||||||
|
data,
|
||||||
...props
|
...props
|
||||||
}: {
|
}: {
|
||||||
i18nKey: string;
|
i18nKey: string;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
namespace?: string;
|
namespace?: string;
|
||||||
|
data?: any;
|
||||||
} & React.HTMLAttributes<HTMLSpanElement>) {
|
} & React.HTMLAttributes<HTMLSpanElement>) {
|
||||||
const t = useTranslations(namespace);
|
const t = useTranslations(namespace);
|
||||||
const helperKey = `${namespace ? `${namespace}.` : ""}${i18nKey}`;
|
const helperKey = `${namespace ? `${namespace}.` : ""}${i18nKey}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span data-i18n-key={helperKey} {...props}>
|
<span data-i18n-key={helperKey} {...props}>
|
||||||
{t(i18nKey)}
|
{t(i18nKey, data)}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user