55 lines
1.4 KiB
TypeScript
55 lines
1.4 KiB
TypeScript
import type { Metadata } from "next";
|
|
import Script from "next/script";
|
|
import { Locale, getDictionary } from "@/lib/i18n";
|
|
|
|
const BASE_URL = "https://soccer-2026.info";
|
|
|
|
export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise<Metadata> {
|
|
const { locale } = await params;
|
|
const dict = getDictionary(locale as Locale);
|
|
return {
|
|
metadataBase: new URL(BASE_URL),
|
|
title: dict.meta.title,
|
|
description: dict.meta.description,
|
|
alternates: {
|
|
canonical: `${BASE_URL}/${locale}`,
|
|
languages: {
|
|
en: `${BASE_URL}/en`,
|
|
de: `${BASE_URL}/de`,
|
|
},
|
|
},
|
|
openGraph: {
|
|
title: dict.meta.title,
|
|
description: dict.meta.description,
|
|
url: `${BASE_URL}/${locale}`,
|
|
locale: locale === "en" ? "en_US" : "de_DE",
|
|
siteName: "WM 2026 Dashboard",
|
|
type: "website",
|
|
},
|
|
};
|
|
}
|
|
|
|
export async function generateStaticParams() {
|
|
return [{ locale: "en" }, { locale: "de" }];
|
|
}
|
|
|
|
export default function LocaleLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
return (
|
|
<>
|
|
{children}
|
|
{process.env.NEXT_PUBLIC_UMAMI_SRC && process.env.NEXT_PUBLIC_UMAMI_ID && (
|
|
<Script
|
|
defer
|
|
src={process.env.NEXT_PUBLIC_UMAMI_SRC}
|
|
data-website-id={process.env.NEXT_PUBLIC_UMAMI_ID}
|
|
strategy="afterInteractive"
|
|
/>
|
|
)}
|
|
</>
|
|
);
|
|
}
|