Files
zhaoguiyang.site/src/pages/zh/index.astro
joyzhao 1476f4eeec feat(i18n): implement astro i18n integration and refactor locale handling
- Add i18n configuration to astro.config.mjs with default locale and routing
- Refactor language handling to use Astro.currentLocale instead of URL parsing
- Update tsconfig to include only necessary files for better type checking
- Improve LanguageSwitcher to handle routing based on astro i18n config
- Add new translation keys and update components to use dynamic titles
- Simplify MotionWrapper component by removing unused default animations
2025-06-15 17:20:29 +08:00

27 lines
1.0 KiB
Plaintext

---
import Layout from "@/layouts/Layout.astro";
import GlassHeader from "@/components/GlassHeader.tsx";
import HeroSection from "@/components/HeroSection.tsx";
import ExperienceSection from "@/components/ExperienceSection.tsx";
import SkillsSection from "@/components/SkillsSection.tsx";
import ProjectsSection from "@/components/ProjectsSection.tsx";
import Footer from "@/components/Footer.tsx";
import { useTranslations } from "@/i18n/utils";
// For /zh/ pages, Astro.currentLocale should be 'zh'.
// We explicitly set lang to 'zh' to ensure type correctness and intent.
const lang: "en" | "zh" = 'zh';
const t = useTranslations(lang);
const pageTitle = t('page.home.title');
---
<Layout title={pageTitle}>
<GlassHeader lang={lang} client:only="react" />
<main class="min-h-screen">
<HeroSection lang={lang} client:only="react" />
<ExperienceSection lang={lang} client:only="react" />
<SkillsSection lang={lang} client:only="react" />
<ProjectsSection lang={lang} client:only="react" />
</main>
<Footer lang={lang} client:load />
</Layout>