fix(i18n): internalize locale logic in LandingPage to resolve content mismatch

This commit is contained in:
dyzulk
2026-01-09 10:55:34 +07:00
parent 3b51264fef
commit 10fd0c3a43
11 changed files with 8 additions and 36 deletions

View File

@@ -1,8 +1,9 @@
import { ArrowRight, Shield, Globe, Lock, Server, Zap, ChevronRight } from "lucide-react";
import Link from 'next/link';
import { useRouter } from 'next/router';
interface LandingPageProps {
locale?: 'en' | 'id';
locale?: string;
}
const translations = {
@@ -46,9 +47,12 @@ const translations = {
}
};
export function LandingPage({ locale = 'en' }: LandingPageProps) {
console.log('LandingPage Locale:', locale);
const t = translations[locale] || translations.en;
export function LandingPage({ locale: propLocale }: LandingPageProps) {
const { locale: routerLocale, defaultLocale } = useRouter();
const currentLocale = (propLocale || routerLocale || defaultLocale || 'en') as 'en' | 'id';
console.log('LandingPage Final Locale:', currentLocale);
const t = translations[currentLocale] || translations.en;
return (
<div className="flex flex-col gap-16 py-8">