Skip to content

Commit 59b9d46

Browse files
committed
fix intl in sc
1 parent 2699afd commit 59b9d46

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

app/[locale]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default async function LocaleLayout({
4646
// Enable static rendering
4747
setRequestLocale(locale)
4848

49-
const allMessages = await getMessages({ locale })
49+
const allMessages = await getMessages()
5050
const messages = pick(allMessages, "common")
5151

5252
const lastDeployDate = getLastDeployDate()

app/[locale]/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
157157
if (!LOCALES_CODES.includes(locale)) return notFound()
158158

159159
setRequestLocale(locale)
160+
160161
const t = await getTranslations({ locale, namespace: "page-index" })
161162
const tCommon = await getTranslations({ locale, namespace: "common" })
162163
const { direction: dir, isRtl } = getDirection(locale)

src/components/Nav/MobileMenu/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { Languages, SearchIcon } from "lucide-react"
22
import { getLocale, getTranslations } from "next-intl/server"
33
import { Trigger as TabsTrigger } from "@radix-ui/react-tabs"
44

5-
import { Lang } from "@/lib/types"
6-
75
import LanguagePicker from "@/components/LanguagePicker"
86
import ExpandIcon from "@/components/Nav/MobileMenu/ExpandIcon"
97
import LvlAccordion from "@/components/Nav/MobileMenu/LvlAccordion"
@@ -117,7 +115,7 @@ export default async function MobileMenu({
117115

118116
async function NavigationContent({ className }: { className?: string }) {
119117
const locale = await getLocale()
120-
const linkSections = await getNavigation(locale as Lang)
118+
const linkSections = await getNavigation()
121119

122120
return (
123121
<nav className={cn("p-0", className)}>

src/components/Nav/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getLocale, getTranslations } from "next-intl/server"
1+
import { getTranslations } from "next-intl/server"
22

33
import { EthHomeIcon } from "@/components/icons"
44

@@ -10,8 +10,7 @@ import { DesktopNavLoading, MobileNavLoading } from "./loading"
1010
import MobileNav from "./MobileNav"
1111

1212
const Nav = async () => {
13-
const locale = await getLocale()
14-
const t = await getTranslations({ locale, namespace: "common" })
13+
const t = await getTranslations({ namespace: "common" })
1514

1615
return (
1716
<nav

src/lib/nav/links.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ export const getLanguagesDisplayInfo = async (): Promise<
3232
})
3333
}
3434

35-
export const getNavigation = async (locale: Lang) => {
35+
export const getNavigation = async () => {
3636
const t = await getTranslations({
37-
locale,
3837
namespace: "common",
3938
})
4039

0 commit comments

Comments
 (0)