feat: complete initial project setup with i18n and standalone config

This commit is contained in:
2026-04-15 22:36:48 +03:00
parent 66f0657fc2
commit de89099b4f
154 changed files with 3350 additions and 119 deletions

66
app/[locale]/layout.tsx Normal file
View File

@@ -0,0 +1,66 @@
import type { Metadata } from "next";
import { Cormorant_Garamond, Oswald } from "next/font/google";
import "../globals.css";
import { NextIntlClientProvider } from 'next-intl';
import { getMessages, getTranslations } from 'next-intl/server';
import { notFound } from 'next/navigation';
import { routing } from '@/i18n/routing';
const cormorant = Cormorant_Garamond({
subsets: ["latin", "latin-ext"],
weight: ["300", "400", "500", "600", "700"],
variable: "--font-serif",
display: 'swap',
});
const oswald = Oswald({
subsets: ["latin", "latin-ext"],
variable: "--font-sans",
display: 'swap',
});
export async function generateMetadata({
params
}: {
params: Promise<{ locale: string }>
}): Promise<Metadata> {
const { locale } = await params;
const t = await getTranslations({ locale, namespace: 'Index' });
return {
title: {
default: t('title') + " | Salmakis Villas",
template: "%s | Salmakis Villas"
},
description: t('description'),
};
}
export default async function RootLayout({
children,
params
}: {
children: React.ReactNode;
params: Promise<{ locale: string }>;
}) {
const { locale } = await params;
// Ensure that the incoming `locale` is valid
if (!routing.locales.includes(locale as "en" | "tr")) {
notFound();
}
// Providing all messages to the client
// side is the easiest way to get started
const messages = await getMessages();
return (
<html lang={locale} className={`${cormorant.variable} ${oswald.variable} scroll-smooth`}>
<body className="font-sans bg-bone text-aegean-dark min-h-screen flex flex-col">
<NextIntlClientProvider messages={messages}>
{children}
</NextIntlClientProvider>
</body>
</html>
);
}