Initial commit: Salmakis Yachting Portal with Cloudinary & i18n

This commit is contained in:
2026-04-14 12:34:19 +03:00
parent e6784f8056
commit 8b1bdfd3c6
99 changed files with 4118 additions and 115 deletions

17
i18n/request.ts Normal file
View File

@@ -0,0 +1,17 @@
import {getRequestConfig} from 'next-intl/server';
import {routing} from './routing';
export default getRequestConfig(async ({requestLocale}) => {
// This typically corresponds to the `[locale]` segment
let locale = await requestLocale;
// Ensure that a valid locale is used
if (!locale || !routing.locales.includes(locale as any)) {
locale = routing.defaultLocale;
}
return {
locale,
messages: (await import(`../messages/${locale}.json`)).default
};
});

15
i18n/routing.ts Normal file
View File

@@ -0,0 +1,15 @@
import {defineRouting} from 'next-intl/routing';
import {createNavigation} from 'next-intl/navigation';
export const routing = defineRouting({
// A list of all locales that are supported
locales: ['en', 'tr'],
// Used when no locale matches
defaultLocale: 'en'
});
// Lightweight wrappers around Next.js' navigation APIs
// that will consider the routing configuration
export const {Link, redirect, usePathname, useRouter} =
createNavigation(routing);