feat: 更新翻译内容,添加关于服务和个人信息的多语言支持

This commit is contained in:
joyzhao
2026-01-08 22:04:09 +08:00
parent 4a4fd423b2
commit b425ac4708
3 changed files with 57 additions and 25 deletions

View File

@@ -19,6 +19,12 @@ export const translations = {
description: 'Full Stack Developer specializing in React, Node.js, and modern web technologies', description: 'Full Stack Developer specializing in React, Node.js, and modern web technologies',
}, },
hero: { hero: {
greeting: "Hello, I'm",
viewProjects: 'View Projects',
contactMe: 'Contact Me',
lookingForJob: 'Looking for a Frontend/TS Full-stack Engineer (Remote)? Contact me!',
digitalNomad: 'Exploring the freelance journey, striving to become a digital nomad',
contactInfo: 'Contact Me',
githubLink: 'GitHub Profile', githubLink: 'GitHub Profile',
linkedinLink: 'LinkedIn Profile', linkedinLink: 'LinkedIn Profile',
}, },
@@ -44,6 +50,16 @@ export const translations = {
blog: { blog: {
slogan: 'This is where innovative thinking meets complex problems.', slogan: 'This is where innovative thinking meets complex problems.',
}, },
services: {
title: 'What I Do',
viewAll: 'Learn More',
},
about: {
title: 'About Me',
sectionTitle: 'About Me',
learnMore: 'Learn More About Me',
toolbox: 'My Toolbox',
},
}, },
zh: { zh: {
nav: { nav: {
@@ -59,6 +75,12 @@ export const translations = {
description: '专注于 React、Node.js 和现代 Web 技术的全栈开发者', description: '专注于 React、Node.js 和现代 Web 技术的全栈开发者',
}, },
hero: { hero: {
greeting: '你好,我是',
viewProjects: '查看项目',
contactMe: '联系我',
lookingForJob: '正在寻找前端/TS 全栈工程师(远程)?联系我!',
digitalNomad: '探索自由职业道路,努力成为数字游民',
contactInfo: '联系我',
githubLink: 'GitHub 主页', githubLink: 'GitHub 主页',
linkedinLink: 'LinkedIn 主页', linkedinLink: 'LinkedIn 主页',
}, },
@@ -69,7 +91,7 @@ export const translations = {
tag: { tag: {
business: '商业项目', business: '商业项目',
opensource: '开源项目', opensource: '开源项目',
personal: '个人产品', personal: '个人项目',
portfolio: '作品集', portfolio: '作品集',
ecommerce: '电子商务', ecommerce: '电子商务',
}, },
@@ -84,6 +106,16 @@ export const translations = {
blog: { blog: {
slogan: '这里是创新思维与复杂问题相遇的地方。', slogan: '这里是创新思维与复杂问题相遇的地方。',
}, },
services: {
title: '我能做什么',
viewAll: '了解更多',
},
about: {
title: '关于我',
sectionTitle: '关于我',
learnMore: '了解更多',
toolbox: '我的工具箱',
},
}, },
} as const; } as const;

View File

@@ -32,7 +32,7 @@ const pageTitle = t('site.title');
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path>
</svg> </svg>
<span class="text-purple-500 font-mono text-lg"> <span class="text-purple-500 font-mono text-lg">
Hello World! I'm {t('hero.greeting')} {personalInfo.name}
</span> </span>
</div> </div>
@@ -72,8 +72,8 @@ const pageTitle = t('site.title');
<!-- Job availability notice --> <!-- Job availability notice -->
<div class="mb-8"> <div class="mb-8">
<p class="text-lg font-medium text-purple-500 mb-2">Looking for a Frontend/TS Full-stack Engineer (Remote)? Contact me!</p> <p class="text-lg font-medium text-purple-500 mb-2">{t('hero.lookingForJob')}</p>
<p class="text-md text-muted-foreground">Exploring the freelance journey, striving to become a digital nomad</p> <p class="text-md text-muted-foreground">{t('hero.digitalNomad')}</p>
</div> </div>
<!-- Action buttons --> <!-- Action buttons -->
@@ -85,7 +85,7 @@ const pageTitle = t('site.title');
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path>
</svg> </svg>
View Projects {t('hero.viewProjects')}
</a> </a>
<a <a
@@ -95,7 +95,7 @@ const pageTitle = t('site.title');
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path>
</svg> </svg>
Contact Me {t('hero.contactMe')}
</a> </a>
</div> </div>
@@ -204,7 +204,7 @@ const pageTitle = t('site.title');
<section id="services" class="py-20 bg-gradient-to-br from-slate-50 to-blue-50 dark:from-slate-900 dark:to-slate-800"> <section id="services" class="py-20 bg-gradient-to-br from-slate-50 to-blue-50 dark:from-slate-900 dark:to-slate-800">
<Container client:load> <Container client:load>
<h2 class="text-4xl font-bold text-center mb-16 bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent"> <h2 class="text-4xl font-bold text-center mb-16 bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent">
Services I Offer {t('services.title')}
</h2> </h2>
<div class="grid md:grid-cols-2 gap-8"> <div class="grid md:grid-cols-2 gap-8">
@@ -235,7 +235,7 @@ const pageTitle = t('site.title');
<svg class="h-5 w-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="h-5 w-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path>
</svg> </svg>
查看所有服务 {t('services.viewAll')}
</a> </a>
</div> </div>
</Container> </Container>
@@ -251,7 +251,7 @@ const pageTitle = t('site.title');
<!-- Section Title --> <!-- Section Title -->
<div class="flex items-center justify-center mb-6"> <div class="flex items-center justify-center mb-6">
<h2 class="text-3xl md:text-4xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent"> <h2 class="text-3xl md:text-4xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent">
About Me {t('about.title')}
</h2> </h2>
</div> </div>
@@ -263,10 +263,10 @@ const pageTitle = t('site.title');
<div> <div>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-6 flex items-center"> <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-6 flex items-center">
<span class="mr-2">👋</span> <span class="mr-2">👋</span>
About Me {t('about.sectionTitle')}
</h3> </h3>
<div class="prose prose-lg dark:prose-invert max-w-none"> <div class="prose prose-lg dark:prose-invert max-w-none">
{personalInfo.about.en.map((paragraph) => ( {personalInfo.about[lang].map((paragraph) => (
<p class="text-gray-700 dark:text-gray-300 leading-relaxed"> <p class="text-gray-700 dark:text-gray-300 leading-relaxed">
{paragraph} {paragraph}
</p> </p>
@@ -277,7 +277,7 @@ const pageTitle = t('site.title');
<svg class="h-5 w-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="h-5 w-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg> </svg>
了解更多关于我 {t('about.learnMore')}
</a> </a>
</div> </div>
</div> </div>
@@ -326,7 +326,7 @@ const pageTitle = t('site.title');
<div class="bg-white/20 dark:bg-gray-800/50 backdrop-blur-sm border border-white/30 dark:border-gray-700/40 rounded-xl p-6 flex flex-col"> <div class="bg-white/20 dark:bg-gray-800/50 backdrop-blur-sm border border-white/30 dark:border-gray-700/40 rounded-xl p-6 flex flex-col">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-6 flex items-center"> <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-6 flex items-center">
<span class="mr-2">💻</span> <span class="mr-2">💻</span>
My Toolbox {t('about.toolbox')}
</h3> </h3>
<div class="space-y-6 flex-1"> <div class="space-y-6 flex-1">

View File

@@ -32,7 +32,7 @@ const pageTitle = t('site.title');
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path>
</svg> </svg>
<span class="text-purple-500 font-mono text-lg"> <span class="text-purple-500 font-mono text-lg">
你好世界!我是 {t('hero.greeting')} {personalInfo.name}
</span> </span>
</div> </div>
@@ -72,8 +72,8 @@ const pageTitle = t('site.title');
<!-- Job availability notice --> <!-- Job availability notice -->
<div class="mb-8"> <div class="mb-8">
<p class="text-lg font-medium text-purple-500 mb-2">如果你正在寻找一名前端/Ts全栈工程师远程工作请联系站长</p> <p class="text-lg font-medium text-purple-500 mb-2">{t('hero.lookingForJob')}</p>
<p class="text-md text-muted-foreground">探索自由职业者之路,努力成为数字游民中的一员</p> <p class="text-md text-muted-foreground">{t('hero.digitalNomad')}</p>
</div> </div>
<!-- Action buttons --> <!-- Action buttons -->
@@ -85,7 +85,7 @@ const pageTitle = t('site.title');
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path>
</svg> </svg>
查看项目 {t('hero.viewProjects')}
</a> </a>
<a <a
@@ -95,7 +95,7 @@ const pageTitle = t('site.title');
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path>
</svg> </svg>
联系我 {t('hero.contactMe')}
</a> </a>
</div> </div>
@@ -204,7 +204,7 @@ const pageTitle = t('site.title');
<section id="services" class="py-20 px-4 bg-gradient-to-br from-slate-50 to-blue-50 dark:from-slate-900 dark:to-slate-800"> <section id="services" class="py-20 px-4 bg-gradient-to-br from-slate-50 to-blue-50 dark:from-slate-900 dark:to-slate-800">
<Container client:load> <Container client:load>
<h2 class="text-4xl font-bold text-center mb-16 bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent"> <h2 class="text-4xl font-bold text-center mb-16 bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent">
我提供的服务 {t('services.title')}
</h2> </h2>
<div class="grid md:grid-cols-2 gap-8"> <div class="grid md:grid-cols-2 gap-8">
@@ -235,7 +235,7 @@ const pageTitle = t('site.title');
<svg class="h-5 w-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="h-5 w-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path>
</svg> </svg>
查看所有服务 {t('services.viewAll')}
</a> </a>
</div> </div>
</Container> </Container>
@@ -251,7 +251,7 @@ const pageTitle = t('site.title');
<!-- Section Title --> <!-- Section Title -->
<div class="flex items-center justify-center mb-6"> <div class="flex items-center justify-center mb-6">
<h2 class="text-3xl md:text-4xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent"> <h2 class="text-3xl md:text-4xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent">
关于我 {t('about.title')}
</h2> </h2>
</div> </div>
@@ -263,10 +263,10 @@ const pageTitle = t('site.title');
<div> <div>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-6 flex items-center"> <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-6 flex items-center">
<span class="mr-2">👋</span> <span class="mr-2">👋</span>
关于我 {t('about.sectionTitle')}
</h3> </h3>
<div class="prose prose-lg dark:prose-invert max-w-none"> <div class="prose prose-lg dark:prose-invert max-w-none">
{personalInfo.about.zh.map((paragraph) => ( {personalInfo.about[lang].map((paragraph) => (
<p class="text-gray-700 dark:text-gray-300 leading-relaxed"> <p class="text-gray-700 dark:text-gray-300 leading-relaxed">
{paragraph} {paragraph}
</p> </p>
@@ -278,7 +278,7 @@ const pageTitle = t('site.title');
<svg class="h-5 w-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="h-5 w-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg> </svg>
了解更多关于我 {t('about.learnMore')}
</a> </a>
</div> </div>
</div> </div>
@@ -327,7 +327,7 @@ const pageTitle = t('site.title');
<div class="bg-white/20 dark:bg-gray-800/50 backdrop-blur-sm border border-white/30 dark:border-gray-700/40 rounded-xl p-6 flex flex-col"> <div class="bg-white/20 dark:bg-gray-800/50 backdrop-blur-sm border border-white/30 dark:border-gray-700/40 rounded-xl p-6 flex flex-col">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-6 flex items-center"> <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-6 flex items-center">
<span class="mr-2">💻</span> <span class="mr-2">💻</span>
我的工具箱 {t('about.toolbox')}
</h3> </h3>
<div class="space-y-6 flex-1"> <div class="space-y-6 flex-1">