From 0889d1e043043d4f25dee792f0f2bb535cc595f4 Mon Sep 17 00:00:00 2001 From: Max Peintner Date: Thu, 19 Jun 2025 15:00:44 +0200 Subject: [PATCH] data prop for i18n --- apps/login/src/components/consent.tsx | 6 +++++- apps/login/src/components/session-clear-item.tsx | 11 +++++++---- apps/login/src/components/translated.tsx | 4 +++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/apps/login/src/components/consent.tsx b/apps/login/src/components/consent.tsx index 5b21ac2a9d..e60ed2901b 100644 --- a/apps/login/src/components/consent.tsx +++ b/apps/login/src/components/consent.tsx @@ -74,7 +74,11 @@ export function ConsentScreen({

- {t("device.request.disclaimer", { appName: appName })} +

{error && ( diff --git a/apps/login/src/components/session-clear-item.tsx b/apps/login/src/components/session-clear-item.tsx index 72cf51d6f5..c219f42eb0 100644 --- a/apps/login/src/components/session-clear-item.tsx +++ b/apps/login/src/components/session-clear-item.tsx @@ -71,10 +71,13 @@ export function SessionClearItem({ {valid ? ( - {verifiedAt && - t("verfiedAt", { - time: moment(timestampDate(verifiedAt)).fromNow(), - })} + {verifiedAt && ( + + )} ) : ( verifiedAt && ( diff --git a/apps/login/src/components/translated.tsx b/apps/login/src/components/translated.tsx index 60cab58256..807ea18e8f 100644 --- a/apps/login/src/components/translated.tsx +++ b/apps/login/src/components/translated.tsx @@ -4,18 +4,20 @@ export function Translated({ i18nKey, children, namespace, + data, ...props }: { i18nKey: string; children?: React.ReactNode; namespace?: string; + data?: any; } & React.HTMLAttributes) { const t = useTranslations(namespace); const helperKey = `${namespace ? `${namespace}.` : ""}${i18nKey}`; return ( - {t(i18nKey)} + {t(i18nKey, data)} ); }