From 308099ca2a20eb01bc403f6aef82353bf00019ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=A9o=20GUILBERT?= Date: Tue, 14 Apr 2026 20:17:17 +0200 Subject: [PATCH] config traduction middleware --- app/{ => [locale]}/globals.css | 0 app/{ => [locale]}/layout.tsx | 0 app/{ => [locale]}/page.tsx | 0 middleware.ts | 12 ++++++++++++ 4 files changed, 12 insertions(+) rename app/{ => [locale]}/globals.css (100%) rename app/{ => [locale]}/layout.tsx (100%) rename app/{ => [locale]}/page.tsx (100%) create mode 100644 middleware.ts diff --git a/app/globals.css b/app/[locale]/globals.css similarity index 100% rename from app/globals.css rename to app/[locale]/globals.css diff --git a/app/layout.tsx b/app/[locale]/layout.tsx similarity index 100% rename from app/layout.tsx rename to app/[locale]/layout.tsx diff --git a/app/page.tsx b/app/[locale]/page.tsx similarity index 100% rename from app/page.tsx rename to app/[locale]/page.tsx diff --git a/middleware.ts b/middleware.ts new file mode 100644 index 0000000..38bc00d --- /dev/null +++ b/middleware.ts @@ -0,0 +1,12 @@ +import { NextResponse } from "next/server"; +import type { NextRequest } from "next/server"; + +export function middleware(request: NextRequest) { + if (request.nextUrl.pathname === '/') { + return NextResponse.redirect(new URL('/fr', request.url)); + } +} + +export const config = { + matcher: '/', +} \ No newline at end of file