diff --git a/apps/web/src/app/[locale]/signups/[signupId]/[signupEditToken]/page.tsx b/apps/web/src/app/[locale]/signups/[signupId]/[signupEditToken]/page.tsx index 7c75183..06ad194 100644 --- a/apps/web/src/app/[locale]/signups/[signupId]/[signupEditToken]/page.tsx +++ b/apps/web/src/app/[locale]/signups/[signupId]/[signupEditToken]/page.tsx @@ -6,7 +6,8 @@ import { deleteSignUpAction, saveSignUpAction, } from "../../../../../lib/api/external/ilmomasiina/actions"; -import { getScopedI18n } from "../../../../../locales/server"; +import { getCurrentLocale, getScopedI18n } from "../../../../../locales/server"; +import { getLocalizedEventTitle } from "../../../../../lib/utils"; import { SignupForm } from "./signup-form"; interface PageProps { @@ -48,6 +49,7 @@ export default async function Page({ throw new Error("Failed to fetch signup info"); } + const locale = await getCurrentLocale(); const t = await getScopedI18n("ilmomasiina.form"); return ( @@ -58,7 +60,8 @@ export default async function Page({

- {t("Edit sign up")} - {signupInfo.data.event.title} + {t("Edit sign up")} -{" "} + {getLocalizedEventTitle(signupInfo.data.event.title, locale)}

{signupInfo.data.signup.status === "in-queue" diff --git a/apps/web/src/app/[locale]/signups/[signupId]/[signupEditToken]/signup-form.tsx b/apps/web/src/app/[locale]/signups/[signupId]/[signupEditToken]/signup-form.tsx index 4d5cebd..e8f91ea 100644 --- a/apps/web/src/app/[locale]/signups/[signupId]/[signupEditToken]/signup-form.tsx +++ b/apps/web/src/app/[locale]/signups/[signupId]/[signupEditToken]/signup-form.tsx @@ -29,7 +29,7 @@ import { useCurrentLocale, useScopedI18n, } from "../../../../../locales/client"; -import { cn } from "../../../../../lib/utils"; +import { cn, getLocalizedEventTitle } from "../../../../../lib/utils"; type FieldErrorI18n = ReturnType; @@ -212,6 +212,7 @@ function Form({ saveAction: typeof saveSignUpAction; deleteAction: typeof deleteSignUpAction; }) { + const locale = useCurrentLocale(); const t = useScopedI18n("ilmomasiina.form"); const [state, formAction] = useFormState(saveAction, null); const isSignupPeriodEnded = @@ -386,7 +387,7 @@ function Form({ />

diff --git a/apps/web/src/components/events-display/index.tsx b/apps/web/src/components/events-display/index.tsx index 0375da2..280e699 100644 --- a/apps/web/src/components/events-display/index.tsx +++ b/apps/web/src/components/events-display/index.tsx @@ -14,7 +14,11 @@ import { import type { IlmomasiinaEvent } from "../../lib/api/external/ilmomasiina"; import { fetchUpcomingEvents } from "../../lib/api/external/ilmomasiina"; import { getCurrentLocale, getI18n } from "../../locales/server"; -import { formatDateTime, formatDateTimeOptions } from "../../lib/utils"; +import { + formatDateTime, + formatDateTimeOptions, + getLocalizedEventTitle, +} from "../../lib/utils"; import { DateTime } from "../datetime"; function EventListSkeleton() { @@ -37,14 +41,14 @@ async function EventItem({ event }: { event: IlmomasiinaEvent }) {
  • - {event.title} + {getLocalizedEventTitle(event.title, locale)}