Fix dynamic default locale routing

This commit is contained in:
MOH
2026-03-15 04:41:08 +01:00
parent 50c3f5cce9
commit 364f761420
13 changed files with 73 additions and 32 deletions
+7 -3
View File
@@ -2,7 +2,7 @@ import Link from "next/link";
import { useLocale, useTranslations } from "next-intl";
import { Container } from "@/components/layout/container";
import { getLocalizedPath } from "@/lib/locale";
import { AppLocale, getLocalizedPath } from "@/lib/locale";
const navItems = [
{ key: "home", path: "" },
@@ -11,7 +11,11 @@ const navItems = [
{ key: "contact", path: "/contact" },
];
export function SiteFooter() {
type SiteFooterProps = {
defaultLocale: AppLocale;
};
export function SiteFooter({ defaultLocale }: SiteFooterProps) {
const locale = useLocale();
const tNav = useTranslations("navigation");
const tFooter = useTranslations("footer");
@@ -23,7 +27,7 @@ export function SiteFooter() {
{navItems.map((item) => (
<Link
key={item.key}
href={getLocalizedPath(locale, item.path || "/")}
href={getLocalizedPath(locale, item.path || "/", defaultLocale)}
className="text-muted-foreground hover:text-foreground"
>
{tNav(item.key)}