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 (
diff --git a/src/app/[locale]/(public)/(auth)/login/page.tsx b/src/app/[locale]/(public)/(auth)/login/page.tsx index 3415c535..040aaea5 100644 --- a/src/app/[locale]/(public)/(auth)/login/page.tsx +++ b/src/app/[locale]/(public)/(auth)/login/page.tsx @@ -14,6 +14,7 @@ export async function generateMetadata({ params: { locale } }: any) { export default function LoginPage({ params: { locale } }: { params: { locale: string } }) { setRequestLocale(locale); + const t = useTranslations('auth.login'); return ( diff --git a/src/app/[locale]/(public)/(auth)/password-reset/page.tsx b/src/app/[locale]/(public)/(auth)/password-reset/page.tsx index 6122c6d7..1db9bc07 100644 --- a/src/app/[locale]/(public)/(auth)/password-reset/page.tsx +++ b/src/app/[locale]/(public)/(auth)/password-reset/page.tsx @@ -4,18 +4,14 @@ import PasswordResetForm from './password-reset-form'; import { AuthNavLayout } from '../../auth-nav-layout'; export async function generateMetadata({ params: { locale } }: any) { - const t = await getTranslations({ locale, namespace: 'auth.passwordReset'}); + const t = await getTranslations({ locale, namespace: 'auth.passwordReset' }); return { title: t('header'), }; } -export default function PasswordResetPage({ - searchParams, -}: { - searchParams: { username: string } -}) { +export default function PasswordResetPage({ searchParams }: { searchParams: { username: string } }) { const t = useTranslations('auth.passwordReset'); const username = searchParams.username; diff --git a/src/app/[locale]/(public)/(auth)/password-reset/success/page.tsx b/src/app/[locale]/(public)/(auth)/password-reset/success/page.tsx index 4f719332..9bb36f1f 100644 --- a/src/app/[locale]/(public)/(auth)/password-reset/success/page.tsx +++ b/src/app/[locale]/(public)/(auth)/password-reset/success/page.tsx @@ -30,7 +30,7 @@ const PageContents = () => { ); }; -export default function PasswordRestoreSuccess() { +export default function PasswordRestoreSuccessPage() { const t = useTranslations('auth.passwordReset.success'); return ( diff --git a/src/app/[locale]/(public)/(support)/complaints/page.tsx b/src/app/[locale]/(public)/(support)/complaints/page.tsx index 7706855e..a89046ea 100644 --- a/src/app/[locale]/(public)/(support)/complaints/page.tsx +++ b/src/app/[locale]/(public)/(support)/complaints/page.tsx @@ -1,6 +1,6 @@ import { useTranslations } from 'next-intl'; import { SupportNavLayout } from '../support-nav-layout'; -import { getTranslations } from 'next-intl/server'; +import { getTranslations, setRequestLocale } from 'next-intl/server'; export async function generateMetadata({ params: { locale } }: any) { const t = await getTranslations({ locale, namespace: 'public.complaints' }); @@ -10,7 +10,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('public.complaints'); return ( diff --git a/src/app/[locale]/(public)/(support)/curator-search/page.tsx b/src/app/[locale]/(public)/(support)/curator-search/page.tsx index d6115a32..c185a798 100644 --- a/src/app/[locale]/(public)/(support)/curator-search/page.tsx +++ b/src/app/[locale]/(public)/(support)/curator-search/page.tsx @@ -1,21 +1,23 @@ import { useTranslations } from 'next-intl'; import { SupportNavLayout } from '../support-nav-layout'; import { CuratorSearch } from './curator-search'; -import { getTranslations } from 'next-intl/server'; +import { getTranslations, setRequestLocale } from 'next-intl/server'; export async function generateMetadata({ params: { locale } }: any) { - const t = await getTranslations({ locale, namespace: 'public.curator-search'}); + const t = await getTranslations({ locale, namespace: 'public.curator-search' }); return { title: t('header'), }; } -export default function CuratorSearchPage() { +export default function CuratorSearchPage({ params: { locale } }: { params: { locale: string } }) { + setRequestLocale(locale); + const t = useTranslations('public.curator-search'); return ( - + ); diff --git a/src/app/[locale]/(public)/(support)/faq/page.tsx b/src/app/[locale]/(public)/(support)/faq/page.tsx index 0d5144ce..2f5239d5 100644 --- a/src/app/[locale]/(public)/(support)/faq/page.tsx +++ b/src/app/[locale]/(public)/(support)/faq/page.tsx @@ -1,21 +1,19 @@ import { useTranslations } from 'next-intl'; import { SupportNavLayout } from '../support-nav-layout'; -import { getTranslations } from 'next-intl/server'; +import { getTranslations, setRequestLocale } from 'next-intl/server'; export async function generateMetadata({ params: { locale } }: any) { - const t = await getTranslations({ locale, namespace: 'public.faq'}); + const t = await getTranslations({ locale, namespace: 'public.faq' }); return { title: t('header'), }; } -export default function FAQ() { +export default function FAQ({ params: { locale } }: { params: { locale: string } }) { + setRequestLocale(locale); + const t = useTranslations('public.faq'); - return ( - - {t.rich('content')} - - ); + return {t.rich('content')}; } diff --git a/src/app/[locale]/(public)/(support)/layout.tsx b/src/app/[locale]/(public)/(support)/layout.tsx index e9bf4319..9aa94f12 100644 --- a/src/app/[locale]/(public)/(support)/layout.tsx +++ b/src/app/[locale]/(public)/(support)/layout.tsx @@ -1,11 +1,16 @@ +import { setRequestLocale } from 'next-intl/server'; import { Footer } from '../footer'; import { Header } from '../header'; export default function PublicPagesLayout({ children, + params: { locale }, }: Readonly<{ children: React.ReactNode; + params: { locale: string }; }>) { + setRequestLocale(locale); + return (
diff --git a/src/app/[locale]/(public)/(support)/support/page.tsx b/src/app/[locale]/(public)/(support)/support/page.tsx index ab95c9f1..4a9ed515 100644 --- a/src/app/[locale]/(public)/(support)/support/page.tsx +++ b/src/app/[locale]/(public)/(support)/support/page.tsx @@ -1,7 +1,7 @@ import { Link } from '@/i18n/routing'; import { useTranslations } from 'next-intl'; import { SupportNavLayout } from '../support-nav-layout'; -import { getTranslations } from 'next-intl/server'; +import { getTranslations, setRequestLocale } from 'next-intl/server'; export async function generateMetadata({ params: { locale } }: any) { const t = await getTranslations({ locale, namespace: 'public.support' }); @@ -11,7 +11,9 @@ export async function generateMetadata({ params: { locale } }: any) { }; } -export default function Support() { +export default function Support({ params: { locale } }: { params: { locale: string } }) { + setRequestLocale(locale); + const t = useTranslations('public.support'); return (