Skip to content

Commit 9681a45

Browse files
committed
remove intl in post page
1 parent b946e17 commit 9681a45

File tree

1 file changed

+6
-4
lines changed
  • src/app/(frontend)/[locale]/posts/[slug]

1 file changed

+6
-4
lines changed

src/app/(frontend)/[locale]/posts/[slug]/page.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ import { generateMeta } from '@/utilities/generateMeta'
1515
import PageClient from './page.client'
1616
import { LivePreviewListener } from '@/components/LivePreviewListener'
1717

18-
import { getTranslations } from 'next-intl/server'
18+
// import { getTranslations } from 'next-intl/server'
1919

2020
type Args = {
2121
params: Promise<{
2222
slug?: string
23+
locale: 'zh' | 'en'
2324
}>
2425
}
2526

@@ -45,12 +46,12 @@ export async function generateStaticParams() {
4546

4647
export default async function Post({ params: paramsPromise }: Args) {
4748
const { isEnabled: draft } = await draftMode()
48-
const { slug = '' } = await paramsPromise
49+
const { slug = '', locale } = await paramsPromise
4950
// Decode to support slugs with special characters
5051
const decodedSlug = decodeURIComponent(slug)
5152
const url = '/posts/' + decodedSlug
5253
const post = await queryPostBySlug({ slug: decodedSlug })
53-
const t = await getTranslations('PostPage')
54+
// const t = await getTranslations('PostPage')
5455

5556
if (!post) return <PayloadRedirects url={url} />
5657

@@ -84,7 +85,8 @@ export default async function Post({ params: paramsPromise }: Args) {
8485
rel="noopener noreferrer"
8586
className="hover:underline"
8687
>
87-
💬 {t('join_the_discussion_on_github')}
88+
{/* 💬 {t('join_the_discussion_on_github')} */}
89+
{locale === 'en' ? 'Join the discussion on GitHub' : '在 GitHub 参与讨论'}
8890
</a>
8991
</div>
9092
)}

0 commit comments

Comments
 (0)