From 4b0770fe442f4d224aaba0783789216c0d513a42 Mon Sep 17 00:00:00 2001 From: Caihaohan Date: Tue, 30 Dec 2025 19:57:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=92=8C=E8=AF=A6=E6=83=85=E9=A1=B5=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 首页 hero 区域标题和描述使用 i18n 翻译 - 首页 "BROWSE BY TAGS" 和 "FEATURED PROJECTS" 使用 i18n 翻译 - 详情页 "BACK TO PROJECTS" 使用 i18n 翻译 - 添加缺失的中英文翻译键 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/app/[locale]/page.tsx | 12 ++++++------ src/app/[locale]/projects/[id]/page.tsx | 4 +++- src/messages/en.json | 10 +++++++++- src/messages/zh.json | 10 +++++++++- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx index ae51ac8..c72d733 100644 --- a/src/app/[locale]/page.tsx +++ b/src/app/[locale]/page.tsx @@ -28,10 +28,10 @@ export default async function HomePage({ params }: HomePageProps) {

- AI PROJECT
NAVIGATOR + {t('heroTitle')}
{t('heroTitle2')}

- Discover and explore high-quality AI projects from across the web. Curated for developers and enthusiasts. + {t('heroDescription')}

}>

- BROWSE BY TAGS + {t('browseByTagsSection')}

@@ -53,16 +53,16 @@ export default async function HomePage({ params }: HomePageProps) { {/* Featured Projects Section */}
-

FEATURED PROJECTS

+

{t('featuredProjectsSection')}

- VIEW ALL + {t('viewAll')}
- VIEW ALL PROJECTS + {t('viewAllProjects')}
diff --git a/src/app/[locale]/projects/[id]/page.tsx b/src/app/[locale]/projects/[id]/page.tsx index 28f7605..3b298c2 100644 --- a/src/app/[locale]/projects/[id]/page.tsx +++ b/src/app/[locale]/projects/[id]/page.tsx @@ -1,4 +1,5 @@ import { notFound } from 'next/navigation' +import { getTranslations } from 'next-intl/server' import { getProjectBySlug, getProjects } from '@/hooks/useProjects' import { ProjectDetail } from '@/components/project/ProjectDetail' import { ProjectSidebar } from '@/components/project/ProjectSidebar' @@ -13,6 +14,7 @@ export default async function ProjectDetailPage({ }: ProjectDetailPageProps) { const resolvedParams = await params const { locale, id } = resolvedParams + const tProject = await getTranslations('project') // Get project by slug const project = await getProjectBySlug(id) @@ -43,7 +45,7 @@ export default async function ProjectDetailPage({ arrow_back - BACK TO PROJECTS + {tProject('backToProjects')} diff --git a/src/messages/en.json b/src/messages/en.json index 359c75c..019a7ec 100644 --- a/src/messages/en.json +++ b/src/messages/en.json @@ -15,9 +15,17 @@ "browseByTag": "Browse by Tag", "searchPlaceholder": "Search AI projects...", "metaTitle": "Agent Park - AI Project Navigator", - "metaDescription": "Discover and explore quality AI projects from across the web" + "metaDescription": "Discover and explore quality AI projects from across the web", + "heroTitle": "AI PROJECT", + "heroTitle2": "NAVIGATOR", + "heroDescription": "Discover and explore high-quality AI projects from across the web. Curated for developers and enthusiasts.", + "browseByTagsSection": "BROWSE BY TAGS", + "featuredProjectsSection": "FEATURED PROJECTS", + "viewAll": "VIEW ALL", + "viewAllProjects": "VIEW ALL PROJECTS" }, "project": { + "backToProjects": "BACK TO PROJECTS", "details": "Project Details", "externalLinks": "External Links", "viewProject": "View Project", diff --git a/src/messages/zh.json b/src/messages/zh.json index 06c1b0a..2af85a5 100644 --- a/src/messages/zh.json +++ b/src/messages/zh.json @@ -15,9 +15,17 @@ "browseByTag": "按标签浏览", "searchPlaceholder": "搜索 AI 项目...", "metaTitle": "Agent Park - AI 项目导航", - "metaDescription": "发现和探索全网优质 AI 项目" + "metaDescription": "发现和探索全网优质 AI 项目", + "heroTitle": "AI 项目", + "heroTitle2": "导航", + "heroDescription": "发现和探索来自全网的高质量 AI 项目。为开发者和爱好者精心策划。", + "browseByTagsSection": "按标签浏览", + "featuredProjectsSection": "精选项目", + "viewAll": "查看全部", + "viewAllProjects": "查看全部项目" }, "project": { + "backToProjects": "返回项目列表", "details": "项目详情", "externalLinks": "外部链接", "viewProject": "查看项目",