File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Metadata } from 'next' ;
22import { Breadcrumbs } from '@/components/Breadcrumbs' ;
3- import { getTranslations } from 'next-intl/server' ;
3+ import { getTranslations , setRequestLocale } from 'next-intl/server' ;
44import { useTranslations } from 'next-intl' ;
55import { generateAlternates } from '@/lib/utils' ;
6+ import { use } from 'react' ;
67import './style.css' ;
78
89
@@ -19,7 +20,9 @@ export async function generateMetadata(
1920 } ;
2021}
2122
22- export default function AboutPage ( ) {
23+ export default function AboutPage ( { params } : { params : Promise < { locale : string } > } ) {
24+ const { locale } = use ( params ) ;
25+ setRequestLocale ( locale ) ;
2326 const t = useTranslations ( 'about' ) ;
2427
2528 return (
@@ -59,4 +62,4 @@ export default function AboutPage() {
5962 </ div >
6063 </ div >
6164 ) ;
62- }
65+ }
Original file line number Diff line number Diff line change 11import { Metadata } from 'next' ;
22import { Breadcrumbs } from '@/components/Breadcrumbs' ;
3- import { getTranslations } from 'next-intl/server' ;
3+ import { getTranslations , setRequestLocale } from 'next-intl/server' ;
44import { useTranslations } from 'next-intl' ;
55import { generateAlternates } from '@/lib/utils' ;
66import { Link } from '@/i18n/navigation' ;
77import { Button } from '@/components/ui/button' ;
88import { BookOpen , ArrowRight } from 'lucide-react' ;
9+ import { use } from 'react' ;
910
1011export async function generateMetadata (
1112 { params } : { params : Promise < { locale : string } > }
@@ -26,7 +27,9 @@ export async function generateMetadata(
2627 } ;
2728}
2829
29- export default function GuidesPage ( ) {
30+ export default function GuidesPage ( { params } : { params : Promise < { locale : string } > } ) {
31+ const { locale } = use ( params ) ;
32+ setRequestLocale ( locale ) ;
3033 const t = useTranslations ( 'guides' ) ;
3134 const common = useTranslations ( 'common' ) ;
3235
Original file line number Diff line number Diff line change 11import { Metadata } from 'next' ;
22import { Breadcrumbs } from '@/components/Breadcrumbs' ;
3- import { getTranslations } from 'next-intl/server' ;
3+ import { getTranslations , setRequestLocale } from 'next-intl/server' ;
44import { useTranslations } from 'next-intl' ;
55import { generateAlternates } from '@/lib/utils' ;
66import { Link } from '@/i18n/navigation' ;
77import { Button } from '@/components/ui/button' ;
88import { Brain , Clock , Target } from 'lucide-react' ;
9+ import { use } from 'react' ;
910
1011export async function generateMetadata (
1112 { params } : { params : Promise < { locale : string } > }
@@ -26,7 +27,9 @@ export async function generateMetadata(
2627 } ;
2728}
2829
29- export default function TestsPage ( ) {
30+ export default function TestsPage ( { params } : { params : Promise < { locale : string } > } ) {
31+ const { locale } = use ( params ) ;
32+ setRequestLocale ( locale ) ;
3033 const t = useTranslations ( 'tests' ) ;
3134 const common = useTranslations ( 'common' ) ;
3235
@@ -121,4 +124,4 @@ export default function TestsPage() {
121124 </ div >
122125 </ div >
123126 ) ;
124- }
127+ }
You can’t perform that action at this time.
0 commit comments