1
1
"use client"
2
2
3
- // TODO: Extract intl strings
4
3
// TODO: Fix RTL compatibility; currently forced to LTR flow
5
4
import { useCallback , useEffect , useMemo , useState } from "react"
6
5
import { useLocale } from "next-intl"
@@ -19,10 +18,15 @@ import {
19
18
import { cn } from "@/lib/utils/cn"
20
19
import { formatDate } from "@/lib/utils/date"
21
20
22
- import { Release , releasesData } from "@/data/roadmap/releases"
21
+ import { getReleasesData , Release } from "@/data/roadmap/releases"
22
+
23
+ import { useTranslation } from "@/hooks/useTranslation"
23
24
24
25
const ReleaseCarousel = ( ) => {
25
26
const locale = useLocale ( )
27
+ const { t } = useTranslation ( "page-roadmap" )
28
+
29
+ const releasesData = useMemo ( ( ) => getReleasesData ( t ) , [ t ] )
26
30
27
31
const [ api1 , setApi1 ] = useState < CarouselApi > ( )
28
32
const [ api2 , setApi2 ] = useState < CarouselApi > ( )
@@ -49,7 +53,7 @@ const ReleaseCarousel = () => {
49
53
50
54
// If no upcoming releases, start at the last production release
51
55
return productionReleases . length - 1
52
- } , [ ] )
56
+ } , [ releasesData ] )
53
57
54
58
const [ currentIndex , setCurrentIndex ] = useState ( startIndex )
55
59
@@ -125,7 +129,9 @@ const ReleaseCarousel = () => {
125
129
currentIndex !== index && "hidden"
126
130
) }
127
131
>
128
- < p className = "text-sm font-bold" > In production</ p >
132
+ < p className = "text-sm font-bold" >
133
+ { t ( "page-roadmap-release-status-prod" ) }
134
+ </ p >
129
135
</ div >
130
136
) }
131
137
{ status === "soon" && (
@@ -136,7 +142,7 @@ const ReleaseCarousel = () => {
136
142
) }
137
143
>
138
144
< p className = "text-sm font-bold text-black" >
139
- Coming soon
145
+ { t ( "page-roadmap-release-status- soon" ) }
140
146
</ p >
141
147
</ div >
142
148
) }
@@ -148,7 +154,7 @@ const ReleaseCarousel = () => {
148
154
) }
149
155
>
150
156
< p className = "text-sm font-bold" >
151
- In development
157
+ { t ( "page-roadmap-release-status-dev" ) }
152
158
</ p >
153
159
</ div >
154
160
) }
@@ -243,17 +249,19 @@ const ReleaseCarousel = () => {
243
249
244
250
< div >
245
251
< p className = "mb-3 text-xl font-bold" >
246
- Main features
252
+ { t ( "page-roadmap-release-main- features" ) }
247
253
</ p >
248
254
< div className = "flex flex-col gap-4" >
249
- { release . content }
255
+ { typeof release . content === "function"
256
+ ? release . content ( t )
257
+ : release . content }
250
258
</ div >
251
259
</ div >
252
260
< ButtonLink
253
261
href = { release . href }
254
262
className = "w-full lg:w-fit"
255
263
>
256
- Learn more
264
+ { t ( "page-roadmap-release-learn- more" ) }
257
265
</ ButtonLink >
258
266
</ div >
259
267
</ div >
0 commit comments