```text
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:
@@ -8,6 +8,7 @@ import {unstable_setRequestLocale} from 'next-intl/server';
|
|||||||
import Footer from "@/components/footer";
|
import Footer from "@/components/footer";
|
||||||
import { Navigation } from "@/components/navigation";
|
import { Navigation } from "@/components/navigation";
|
||||||
import { notFound } from "next/navigation";
|
import { notFound } from "next/navigation";
|
||||||
|
import {routing} from '@/i18n/routing';
|
||||||
|
|
||||||
const inter = Inter({ subsets: ["latin"] });
|
const inter = Inter({ subsets: ["latin"] });
|
||||||
|
|
||||||
@@ -28,7 +29,7 @@ async function getMessages(locale: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function generateStaticParams() {
|
export function generateStaticParams() {
|
||||||
return SUPPORTED_LANGUAGES.map((locale) => ({locale}));
|
return routing.locales.map((locale) => ({locale}));
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function RootLayout({
|
export default async function RootLayout({
|
||||||
|
|||||||
Reference in New Issue
Block a user