jp-visser/app/[lang]/page.tsx
Madhura68 d352a7d496 Add i18n support with NL/EN language switching (ST-001)
- Add English translations to cv-data.ts with getCvData(lang) helper
- Create app/[lang]/ routing with static generation for nl and en
- Add language switcher in nav (NL / EN toggle)
- Add middleware for Accept-Language auto-redirect on root path
- Root layout reads x-lang header to set <html lang> correctly
- All components accept lang prop and render translated content

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 15:31:13 +02:00

39 lines
1.1 KiB
TypeScript

import { redirect } from "next/navigation";
import type { Lang } from "@/lib/cv-data";
import { Nav } from "@/components/nav";
import { Hero } from "@/components/hero";
import { MotivationSection } from "@/components/motivation";
import { ExperienceSection } from "@/components/experience";
import { SkillsSection } from "@/components/skills";
import { AppsSection } from "@/components/apps";
import { ContactSection } from "@/components/contact";
import { Footer } from "@/components/footer";
const VALID_LANGS: Lang[] = ["nl", "en"];
export default async function LangPage({
params,
}: {
params: Promise<{ lang: string }>;
}) {
const { lang } = await params;
if (!VALID_LANGS.includes(lang as Lang)) {
redirect("/nl");
}
const currentLang = lang as Lang;
return (
<>
<Nav lang={currentLang} />
<Hero lang={currentLang} />
<MotivationSection lang={currentLang} />
<ExperienceSection lang={currentLang} />
<SkillsSection lang={currentLang} />
<AppsSection lang={currentLang} />
<ContactSection lang={currentLang} />
<Footer />
</>
);
}