Skip to content

Commit 9963b4a

Browse files
committed
fix: i18n support for the 10-year anniversary client banner
1 parent 4aaa5b6 commit 9963b4a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

app/[locale]/page.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import { Fragment } from "react"
2+
import { pick } from "lodash"
23
import dynamic from "next/dynamic"
34
import { notFound } from "next/navigation"
4-
import { getTranslations, setRequestLocale } from "next-intl/server"
5+
import {
6+
getMessages,
7+
getTranslations,
8+
setRequestLocale,
9+
} from "next-intl/server"
510
import { FaDiscord, FaGithub } from "react-icons/fa6"
611
import { FaXTwitter } from "react-icons/fa6"
712

@@ -19,6 +24,7 @@ import BentoCard from "@/components/Homepage/BentoCard"
1924
import CodeExamples from "@/components/Homepage/CodeExamples"
2025
import { getBentoBoxItems } from "@/components/Homepage/utils"
2126
import ValuesMarqueeFallback from "@/components/Homepage/ValuesMarquee/Fallback"
27+
import I18nProvider from "@/components/I18nProvider"
2228
import BlockHeap from "@/components/icons/block-heap.svg"
2329
import BuildAppsIcon from "@/components/icons/build-apps.svg"
2430
import Calendar from "@/components/icons/calendar.svg"
@@ -162,6 +168,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
162168
const tCommon = await getTranslations({ locale, namespace: "common" })
163169
const { direction: dir, isRtl } = getDirection(locale)
164170

171+
const allMessages = await getMessages({ locale })
172+
const tenYearMessages = pick(allMessages, "page-10-year-anniversary")
173+
165174
const [
166175
ethPrice,
167176
totalEthStaked,
@@ -813,7 +822,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
813822
id="10-year-anniversary"
814823
className={cn(locale !== "en" && "hidden")} // TODO: Show again when translations ready
815824
>
816-
<TenYearHomeBanner />
825+
<I18nProvider locale={locale} messages={tenYearMessages}>
826+
<TenYearHomeBanner />
827+
</I18nProvider>
817828
</Section>
818829

819830
{/* Recent posts */}

0 commit comments

Comments
 (0)