Fix dynamic default locale routing
This commit is contained in:
@@ -6,6 +6,7 @@ import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/layout/container";
|
||||
import { MotionFade } from "@/components/motion-fade";
|
||||
import { HeroShell, HeroTitle } from "@/components/layout/site-hero";
|
||||
import { getSiteSettings } from "@/lib/app-config";
|
||||
import { buildLocalizedMetadata } from "@/lib/metadata";
|
||||
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
import { AppCard } from "@/components/ui/app-card";
|
||||
@@ -34,7 +35,10 @@ export async function generateMetadata({ params }: SuccessPageProps): Promise<Me
|
||||
export default async function SuccessPage({ params }: SuccessPageProps) {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "successPage" });
|
||||
const [t, siteSettings] = await Promise.all([
|
||||
getTranslations({ locale: localeKey, namespace: "successPage" }),
|
||||
getSiteSettings(),
|
||||
]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -51,10 +55,10 @@ export default async function SuccessPage({ params }: SuccessPageProps) {
|
||||
</p>
|
||||
<div className="mt-8 flex flex-wrap items-center justify-center gap-3">
|
||||
<Button asChild>
|
||||
<Link href={getLocalizedPath(localeKey)}>{t("home")}</Link>
|
||||
<Link href={getLocalizedPath(localeKey, "/", siteSettings.defaultLocale)}>{t("home")}</Link>
|
||||
</Button>
|
||||
<Button asChild variant="outline">
|
||||
<Link href={getLocalizedPath(localeKey, "/contact")}>{t("contact")}</Link>
|
||||
<Link href={getLocalizedPath(localeKey, "/contact", siteSettings.defaultLocale)}>{t("contact")}</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user