diff --git a/src/app/[locale]/(private)/about/page.tsx b/src/app/[locale]/(private)/about/page.tsx index 0b17ff06..bb329a8b 100644 --- a/src/app/[locale]/(private)/about/page.tsx +++ b/src/app/[locale]/(private)/about/page.tsx @@ -1,7 +1,7 @@ import { Heading1, Heading4 } from '@/components/typography/headers'; import { SubLayout } from '../sub-layout'; import { useTranslations } from 'next-intl'; -import { getTranslations } from 'next-intl/server'; +import { getTranslations, setRequestLocale } from 'next-intl/server'; const INTL_NAMESPACE = 'private.about'; @@ -13,7 +13,9 @@ export async function generateMetadata({ params: { locale } }: any) { }; } -export default function AboutPage() { +export default function AboutPage({ params: { locale } }: { params: { locale: string } }) { + setRequestLocale(locale); + const t = useTranslations(INTL_NAMESPACE); return ( diff --git a/src/app/[locale]/(private)/contacts/complaints/page.tsx b/src/app/[locale]/(private)/contacts/complaints/page.tsx index 7ffe3efd..5ca2432c 100644 --- a/src/app/[locale]/(private)/contacts/complaints/page.tsx +++ b/src/app/[locale]/(private)/contacts/complaints/page.tsx @@ -1,5 +1,5 @@ import { useTranslations } from 'next-intl'; -import { getTranslations } from 'next-intl/server'; +import { getTranslations, setRequestLocale } from 'next-intl/server'; import { SubLayout } from '../../sub-layout'; import { Heading1 } from '@/components/typography/headers'; import { Paragraph } from '@/components/typography/paragraph'; @@ -14,7 +14,9 @@ export async function generateMetadata({ params: { locale } }: any) { }; } -export default function ComplaintsPage() { +export default function ComplaintsPage({ params: { locale } }: { params: { locale: string } }) { + setRequestLocale(locale); + const t = useTranslations(INTL_NAMESPACE); const contactsT = useTranslations('private.contacts'); diff --git a/src/app/[locale]/(private)/contacts/page.tsx b/src/app/[locale]/(private)/contacts/page.tsx index 343174be..6585640b 100644 --- a/src/app/[locale]/(private)/contacts/page.tsx +++ b/src/app/[locale]/(private)/contacts/page.tsx @@ -1,7 +1,7 @@ import { Heading1, Heading3 } from '@/components/typography/headers'; import { SubLayout } from '../sub-layout'; import { useTranslations } from 'next-intl'; -import { getTranslations } from 'next-intl/server'; +import { getTranslations, setRequestLocale } from 'next-intl/server'; import { Link } from '@/i18n/routing'; import { TextButton } from '@/components/ui/text-button'; import { ChatsTeardrop, EnvelopeSimple } from '@/app/images'; @@ -16,7 +16,9 @@ export async function generateMetadata({ params: { locale } }: any) { }; } -export default function ContactsPage() { +export default function ContactsPage({ params: { locale } }: { params: { locale: string } }) { + setRequestLocale(locale); + const t = useTranslations(INTL_NAMESPACE); return ( diff --git a/src/app/[locale]/(private)/frequently-asked-questions/page.tsx b/src/app/[locale]/(private)/frequently-asked-questions/page.tsx index 1f4642ca..abb1fff1 100644 --- a/src/app/[locale]/(private)/frequently-asked-questions/page.tsx +++ b/src/app/[locale]/(private)/frequently-asked-questions/page.tsx @@ -2,7 +2,7 @@ import { Heading1, Heading4 } from '@/components/typography/headers'; import { SubLayout } from '../sub-layout'; import { useTranslations } from 'next-intl'; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; -import { getTranslations } from 'next-intl/server'; +import { getTranslations, setRequestLocale } from 'next-intl/server'; const SECTIONS = ['how-to-register', 'how-to-restore-password']; @@ -16,7 +16,9 @@ export async function generateMetadata({ params: { locale } }: any) { }; } -export default function FAQPage() { +export default function FAQPage({ params: { locale } }: { params: { locale: string } }) { + setRequestLocale(locale); + const t = useTranslations(INTL_NAMESPACE); return ( diff --git a/src/app/[locale]/(private)/kpi-documents/page.tsx b/src/app/[locale]/(private)/kpi-documents/page.tsx index 9dabf78b..03e60a24 100644 --- a/src/app/[locale]/(private)/kpi-documents/page.tsx +++ b/src/app/[locale]/(private)/kpi-documents/page.tsx @@ -1,7 +1,7 @@ import { Heading1 } from '@/components/typography/headers'; import { useTranslations } from 'next-intl'; import { SubLayout } from '../sub-layout'; -import { getTranslations } from 'next-intl/server'; +import { getTranslations, setRequestLocale } from 'next-intl/server'; import { BookBookmark, BookOpen, Roll } from '@/app/images'; import { DocumentCard } from './document-card'; @@ -15,7 +15,9 @@ export async function generateMetadata({ params: { locale } }: any) { }; } -export default function KPIDocumentsPage() { +export default function KPIDocumentsPage({ params: { locale } }: { params: { locale: string } }) { + setRequestLocale(locale); + const t = useTranslations(INTL_NAMESPACE); return ( diff --git a/src/app/[locale]/(private)/terms-of-service/page.tsx b/src/app/[locale]/(private)/terms-of-service/page.tsx index 36d9d6b3..a61f8ee8 100644 --- a/src/app/[locale]/(private)/terms-of-service/page.tsx +++ b/src/app/[locale]/(private)/terms-of-service/page.tsx @@ -1,7 +1,7 @@ import { Heading1 } from '@/components/typography/headers'; import { SubLayout } from '../sub-layout'; import { useTranslations } from 'next-intl'; -import { getTranslations } from 'next-intl/server'; +import { getTranslations, setRequestLocale } from 'next-intl/server'; const INTL_NAMESPACE = 'private.terms-of-service'; @@ -13,7 +13,9 @@ export async function generateMetadata({ params: { locale } }: any) { }; } -export default function TermsOfServicePage() { +export default function TermsOfServicePage({ params: { locale } }: { params: { locale: string } }) { + setRequestLocale(locale); + const t = useTranslations(INTL_NAMESPACE); return ( diff --git a/src/app/[locale]/(private)/user-manual/page.tsx b/src/app/[locale]/(private)/user-manual/page.tsx index 0213a63e..2f21ef1a 100644 --- a/src/app/[locale]/(private)/user-manual/page.tsx +++ b/src/app/[locale]/(private)/user-manual/page.tsx @@ -2,7 +2,7 @@ import { Heading1 } from '@/components/typography/headers'; import { useTranslations } from 'next-intl'; import { SubLayout } from '../sub-layout'; import { DownloadButton } from './download-button'; -import { getTranslations } from 'next-intl/server'; +import { getTranslations, setRequestLocale } from 'next-intl/server'; const USER_MANUAL_URL = process.env.NEXT_PUBLIC_USER_MANUAL_URL!; @@ -16,7 +16,9 @@ export async function generateMetadata({ params: { locale } }: any) { }; } -export default function UserManualPage() { +export default function UserManualPage({ params: { locale } }: { params: { locale: string } }) { + setRequestLocale(locale); + const t = useTranslations(INTL_NAMESPACE); return ( diff --git a/src/app/[locale]/(public)/(auth)/layout.tsx b/src/app/[locale]/(public)/(auth)/layout.tsx index 6a42ebc8..192a8d21 100644 --- a/src/app/[locale]/(public)/(auth)/layout.tsx +++ b/src/app/[locale]/(public)/(auth)/layout.tsx @@ -1,12 +1,17 @@ +import { setRequestLocale } from 'next-intl/server'; import { Footer } from '../footer'; import { Header } from '../header'; import { LoginCarousel } from './login-carousel'; export default function AuthLayout({ children, + params: { locale }, }: Readonly<{ children: React.ReactNode; + params: { locale: string }; }>) { + setRequestLocale(locale); + return (