Skip to content

Commit

Permalink
fix: properly localize event title on event page
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelSiidorow committed Oct 31, 2024
1 parent 9f69a44 commit 99057c1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/web/src/app/[locale]/events/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
formatDateTimeSecondsOptions,
formatDatetimeYear,
formatDatetimeYearOptions,
getLocalizedEventTitle,
getQuotasWithOpenAndQueue,
} from "../../../../lib/utils";
import { BackButton } from "../../../../components/back-button";
Expand Down Expand Up @@ -422,9 +423,10 @@ export const generateMetadata = async ({
console.warn("Failed to fetch event from Ilmomasiina", event.error);
return {};
}
const locale = await getCurrentLocale();

return {
title: event.data.title,
title: getLocalizedEventTitle(event.data.title, locale),
description: event.data.description,
openGraph: {
...openGraphImage,
Expand Down Expand Up @@ -453,7 +455,9 @@ export default async function Page({ params: { slug } }: PageProps) {
<div className="relative m-auto flex max-w-full flex-col gap-8 p-4 md:p-6">
<div className="max-w-4xl space-y-4 md:my-8 md:space-y-8">
<BackButton>{t("Back")}</BackButton>
<h1 className="font-mono text-2xl md:text-4xl">{event.data.title}</h1>
<h1 className="font-mono text-2xl md:text-4xl">
{getLocalizedEventTitle(event.data.title, locale)}
</h1>
<div className="flex flex-col gap-16">
<div className="flex flex-col gap-4 md:flex-row md:gap-16">
<div className="flex max-w-xl grow-[2] flex-col gap-8">
Expand Down

0 comments on commit 99057c1

Please sign in to comment.