@@ -15,11 +15,12 @@ import { generateMeta } from '@/utilities/generateMeta'
1515import PageClient from './page.client'
1616import { LivePreviewListener } from '@/components/LivePreviewListener'
1717
18- import { getTranslations } from 'next-intl/server'
18+ // import { getTranslations } from 'next-intl/server'
1919
2020type Args = {
2121 params : Promise < {
2222 slug ?: string
23+ locale : 'zh' | 'en'
2324 } >
2425}
2526
@@ -45,12 +46,12 @@ export async function generateStaticParams() {
4546
4647export 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