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
+4 -3
View File
@@ -61,9 +61,10 @@ export async function generateMetadata({ params }: HomePageProps): Promise<Metad
export default async function HomePage({ params }: HomePageProps) {
const { locale } = await params;
const localeKey = resolveLocale(locale);
const [t, marqueeSettings] = await Promise.all([
const [t, marqueeSettings, siteSettings] = await Promise.all([
getTranslations({ locale: localeKey, namespace: "homepage" }),
getMarqueeSettings(),
getSiteSettings(),
]);
const serviceItems = [
t("serviceBrand"),
@@ -108,7 +109,7 @@ export default async function HomePage({ params }: HomePageProps) {
</p>
<div className="mt-8 flex flex-wrap gap-3">
<Button asChild size="lg" className="min-w-[11rem]">
<Link href={getLocalizedPath(localeKey, "/contact")}>
<Link href={getLocalizedPath(localeKey, "/contact", siteSettings.defaultLocale)}>
{t("servicesPrimaryCta")}
<ArrowRight className="h-4 w-4" />
</Link>
@@ -119,7 +120,7 @@ export default async function HomePage({ params }: HomePageProps) {
variant="outline"
className="min-w-[11rem] border-border/80 bg-background/70 hover:bg-background"
>
<Link href={getLocalizedPath(localeKey, "/portfolio")}>
<Link href={getLocalizedPath(localeKey, "/portfolio", siteSettings.defaultLocale)}>
{t("servicesSecondaryCta")}
</Link>
</Button>