File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/app/(frontend)/[locale] Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { draftMode } from 'next/headers'
44import RefreshRouteOnSave from '@/components/admin/RefreshRouteOnSave'
55import { MainPageImage , Media } from '@/payload-types'
66import { RichText } from '@payloadcms/richtext-lexical/react'
7- import { getTranslations } from 'next-intl/server'
7+ import { getTranslations , setRequestLocale } from 'next-intl/server'
88import headersConverter from '@/lib/utils/converter'
99import { Metadata } from 'next'
1010
@@ -192,6 +192,7 @@ export const dynamic = 'error'
192192export default async function MainPage ( { params } : Props ) {
193193 const payload = await getPayload ( { config } )
194194 const { locale } = await params
195+ setRequestLocale ( locale )
195196 const t = await getTranslations ( { locale, namespace : 'NavBar' } )
196197
197198 const { isEnabled } = await draftMode ( )
@@ -215,7 +216,7 @@ export default async function MainPage({ params }: Props) {
215216 return (
216217 < div
217218 id = "welcome"
218- className = "header-screen flex flex-col lg:flex-row [&_figcaption]:flex [&_figcaption]:items-center [&_figcaption]:justify-center [&_figure]:pb-0! justify-stretch items-center grow lg:px-10 mb-20 lg:mb-0"
219+ className = "header-screen flex flex-col lg:flex-row [&_figcaption]:flex [&_figcaption]:items-center [&_figcaption]:justify-center [&_figure]:pb-0! [&>div]:px-0! justify-stretch items-center grow lg:px-10 mb-20 lg:mb-0"
219220 key = { image . id }
220221 style = { { backgroundColor : image . bgColor } }
221222 >
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { Suspense } from 'react'
55import { draftMode } from 'next/headers'
66import RefreshRouteOnSave from '@/components/admin/RefreshRouteOnSave'
77import { Metadata } from 'next'
8- import { getTranslations } from 'next-intl/server'
8+ import { getTranslations , setRequestLocale } from 'next-intl/server'
99import { Media } from '@/payload-types'
1010
1111export const dynamic = 'error'
@@ -45,6 +45,8 @@ export async function generateMetadata({
4545} ) : Promise < Metadata > {
4646 const { locale } = await params
4747
48+ setRequestLocale ( locale )
49+
4850 const t = await getTranslations ( { locale } )
4951 const title = t ( 'NavBar.projects' )
5052
You can’t perform that action at this time.
0 commit comments