Fix runtime default locale resolution
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-15 06:02:27 +01:00
parent 9b8409a7d3
commit c18128c965
29 changed files with 330 additions and 108 deletions
+1 -1
View File
@@ -59,8 +59,8 @@ function getStringValue(formData: FormData, key: string) {
}
export async function submitContactFormAction(formData: FormData) {
const locale = resolveLocale(String(formData.get("locale") ?? ""));
const siteSettings = await getSiteSettings();
const locale = resolveLocale(String(formData.get("locale") ?? ""), siteSettings.defaultLocale);
const contactPath = getLocalizedPath(locale, "/contact", siteSettings.defaultLocale);
try {
+3 -3
View File
@@ -8,7 +8,7 @@ import { MotionFade } from "@/components/motion-fade";
import { ContactForm } from "@/components/site/contact-form";
import { buildLocalizedMetadata } from "@/lib/metadata";
import { getPublicContactProtectionSettings, getSiteSettings } from "@/lib/app-config";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { FALLBACK_LOCALE, getLocalizedPath, resolveLocale } from "@/lib/locale";
import { AppCard } from "@/components/ui/app-card";
import { CardContent, CardHeader, CardTitle } from "@/components/ui/card";
@@ -22,7 +22,7 @@ type ContactPageProps = {
export async function generateMetadata({ params }: ContactPageProps): Promise<Metadata> {
const { locale } = await params;
const localeKey = resolveLocale(locale);
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
const t = await getTranslations({ locale: localeKey, namespace: "contactPage" });
return await buildLocalizedMetadata({
@@ -35,7 +35,7 @@ export async function generateMetadata({ params }: ContactPageProps): Promise<Me
export default async function ContactPage({ params }: ContactPageProps) {
const { locale } = await params;
const localeKey = resolveLocale(locale);
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
const [t, protection, siteSettings] = await Promise.all([
getTranslations({ locale: localeKey, namespace: "contactPage" }),
getPublicContactProtectionSettings(),