diff --git a/src/app/layout.tsx b/src/app/layout.tsx new file mode 100644 index 0000000..05c5fd3 --- /dev/null +++ b/src/app/layout.tsx @@ -0,0 +1,14 @@ + +import {ReactNode} from 'react'; + + +type Props = { + children: ReactNode; +}; + + +// Since we have a `not-found.tsx` page on the root, a layout file +// is required, even if it's just passing children through. +export default function RootLayout({children}: Props) { + return children; +} \ No newline at end of file diff --git a/src/app/page.tsx b/src/app/page.tsx new file mode 100644 index 0000000..9594e6b --- /dev/null +++ b/src/app/page.tsx @@ -0,0 +1,7 @@ + +import {redirect} from 'next/navigation'; + + +export default function RootPage() { + redirect('/en'); +} \ No newline at end of file diff --git a/src/middleware.ts b/src/middleware.ts deleted file mode 100644 index b647cc6..0000000 --- a/src/middleware.ts +++ /dev/null @@ -1,22 +0,0 @@ -import createMiddleware from 'next-intl/middleware'; -import {NextRequest} from 'next/server'; - -export default async function middleware(request: NextRequest) { - // Step 1: Use the incoming request (example) - const defaultLocale = request.headers.get('x-your-custom-locale') || 'en'; - - // Step 2: Create and call the next-intl middleware (example) - const handleI18nRouting = createMiddleware({ - locales: ['en', 'de'], - defaultLocale, - localePrefix: "always", - }); - const response = handleI18nRouting(request); - - return response; -} - -export const config = { - // Match only internationalized pathnames - matcher: ['/', '/(de|en)/:path*'] -}; \ No newline at end of file