添加i18n
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Playfair_Display, Noto_Serif_SC } from "next/font/google";
|
||||
import "../globals.css";
|
||||
import Navbar from "@/components/Navbar";
|
||||
import Footer from "@/components/Footer";
|
||||
import {NextIntlClientProvider} from 'next-intl';
|
||||
import {getMessages} from 'next-intl/server';
|
||||
import {notFound} from 'next/navigation';
|
||||
|
||||
const playfairDisplay = Playfair_Display({
|
||||
variable: "--font-serif",
|
||||
subsets: ["latin"],
|
||||
weight: ["400", "600", "700"],
|
||||
style: ["normal", "italic"],
|
||||
});
|
||||
|
||||
const notoSerifSC = Noto_Serif_SC({
|
||||
variable: "--font-serif-sc",
|
||||
subsets: ["latin"],
|
||||
weight: ["300", "400", "500", "700"],
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "南京市肥鹅信息技术有限公司 | Nanjing Feie Information Technology",
|
||||
description: "南京市肥鹅信息技术有限公司致力于为企业提供卓越的数字化解决方案,以创新技术驱动商业价值。",
|
||||
};
|
||||
|
||||
export default async function LocaleLayout({
|
||||
children,
|
||||
params
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
params: Promise<{locale: string}>;
|
||||
}) {
|
||||
const { locale } = await params;
|
||||
if (!['en', 'zh', 'ja'].includes(locale)) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
const messages = await getMessages();
|
||||
|
||||
return (
|
||||
<html lang={locale}>
|
||||
<body
|
||||
className={`${playfairDisplay.variable} ${notoSerifSC.variable} antialiased selection:bg-feie-gold selection:text-white`}
|
||||
>
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
<Navbar />
|
||||
{children}
|
||||
<Footer />
|
||||
</NextIntlClientProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import Hero from '@/components/Hero';
|
||||
import About from '@/components/About';
|
||||
import Services from '@/components/Services';
|
||||
import Contact from '@/components/Contact';
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<main className='overflow-hidden'>
|
||||
<Hero />
|
||||
<About />
|
||||
<Services />
|
||||
<Contact />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user