feat: Update routing in layout.tsx

Refactor the generateStaticParams function in layout.tsx to use the routing.locales array instead of the deprecated SUPPORTED_LANGUAGES array. This change ensures that the language options in the website's layout are dynamically generated based on the available locales.
This commit is contained in:
mauro-balades
2024-09-02 19:50:10 +02:00
parent 0bdd1eaa28
commit c338f3d04e

View File

@@ -8,6 +8,7 @@ import {unstable_setRequestLocale} from 'next-intl/server';
import Footer from "@/components/footer";
import { Navigation } from "@/components/navigation";
import { notFound } from "next/navigation";
import {routing} from '@/i18n/routing';
const inter = Inter({ subsets: ["latin"] });
@@ -28,7 +29,7 @@ async function getMessages(locale: string) {
}
export function generateStaticParams() {
return SUPPORTED_LANGUAGES.map((locale) => ({locale}));
return routing.locales.map((locale) => ({locale}));
}
export default async function RootLayout({