From bee0ab07b4e7ae2bd74feca7e1437ea0b9e7e659 Mon Sep 17 00:00:00 2001 From: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com> Date: Wed, 6 Nov 2024 04:25:20 +0530 Subject: [PATCH] fix: person response page and copy link transalation issue (#4239) Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com> --- .../people/[personId]/components/ResponseSection.tsx | 4 ++-- .../(organization)/general/components/ShareInviteModal.tsx | 2 +- packages/ui/components/ErrorComponent/index.tsx | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection.tsx index f0ff487236..0295b1d4b9 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection.tsx @@ -1,6 +1,6 @@ import { ResponseTimeline } from "@/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseTimeline"; import { getServerSession } from "next-auth"; -import { useTranslations } from "next-intl"; +import { getTranslations } from "next-intl/server"; import { authOptions } from "@formbricks/lib/authOptions"; import { getResponsesByPersonId } from "@formbricks/lib/response/service"; import { getSurveys } from "@formbricks/lib/survey/service"; @@ -28,7 +28,7 @@ export const ResponseSection = async ({ const surveyIds = responses?.map((response) => response.surveyId) || []; const surveys: TSurvey[] = surveyIds.length === 0 ? [] : ((await getSurveys(environment.id)) ?? []); const session = await getServerSession(authOptions); - const t = useTranslations(); + const t = await getTranslations(); if (!session) { throw new Error(t("common.no_session_found")); } diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/general/components/ShareInviteModal.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/general/components/ShareInviteModal.tsx index 830f42ae18..38599610c8 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/general/components/ShareInviteModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/general/components/ShareInviteModal.tsx @@ -65,7 +65,7 @@ export const ShareInviteModal = ({ inviteToken, open, setOpen }: ShareInviteModa title={t("environments.settings.general.copy_invite_link_to_clipboard")} aria-label="Copy invite link to clipboard" EndIcon={CopyIcon}> - {t("common.copy_url")} + {t("common.copy_link")} diff --git a/packages/ui/components/ErrorComponent/index.tsx b/packages/ui/components/ErrorComponent/index.tsx index 91f457e223..2895dd1896 100644 --- a/packages/ui/components/ErrorComponent/index.tsx +++ b/packages/ui/components/ErrorComponent/index.tsx @@ -1,8 +1,8 @@ import { XCircleIcon } from "lucide-react"; -import { getTranslations } from "next-intl/server"; +import { useTranslations } from "next-intl"; -export const ErrorComponent: React.FC = async ({}) => { - const t = await getTranslations(); +export const ErrorComponent: React.FC = () => { + const t = useTranslations(); return (