Fix request locale resolution in site pages
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-15 08:20:39 +01:00
parent c18128c965
commit 288e4b37d7
10 changed files with 80 additions and 81 deletions
+9 -6
View File
@@ -1,10 +1,11 @@
import type { Metadata } from "next";
import { getTranslations } from "next-intl/server";
import { getLocale, getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { PageHero } from "@/components/layout/page-hero";
import { AppCard } from "@/components/ui/app-card";
import { FALLBACK_LOCALE, resolveLocale } from "@/lib/locale";
import { getSiteSettings } from "@/lib/app-config";
import { resolveLocale } from "@/lib/locale";
import { buildLocalizedMetadata } from "@/lib/metadata";
type AboutPageProps = {
@@ -16,8 +17,9 @@ type AboutPageProps = {
export const dynamic = "force-dynamic";
export async function generateMetadata({ params }: AboutPageProps): Promise<Metadata> {
const { locale } = await params;
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
await params;
const siteSettings = await getSiteSettings();
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
const t = await getTranslations({ locale: localeKey, namespace: "aboutPage" });
return await buildLocalizedMetadata({
@@ -29,8 +31,9 @@ export async function generateMetadata({ params }: AboutPageProps): Promise<Meta
}
export default async function AboutPage({ params }: AboutPageProps) {
const { locale } = await params;
const localeKey = resolveLocale(locale, FALLBACK_LOCALE);
await params;
const siteSettings = await getSiteSettings();
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
const t = await getTranslations({ locale: localeKey, namespace: "aboutPage" });
return (