From 590123f6ad4ddbf638cc955d334863f733715fab Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Tue, 29 Aug 2023 18:59:49 +0200 Subject: [PATCH] middleware.ts: hardcode `ja` --- nextjs/src/middleware.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nextjs/src/middleware.ts b/nextjs/src/middleware.ts index 8688d5acbe..4ca61dae2e 100644 --- a/nextjs/src/middleware.ts +++ b/nextjs/src/middleware.ts @@ -6,7 +6,7 @@ export function middleware(request) { const locale = request.nextUrl.searchParams.get('locale'); if (locale === 'ja') { return NextResponse.redirect( - new URL(`/${locale}/${pathname}`, request.url), + new URL(`/ja/${pathname}`, request.url), ); } @@ -26,4 +26,4 @@ export const config = { // Skip all paths that should not be internationalized. This example skips the // folders "api", "_next" and all files with an extension (e.g. favicon.ico) matcher: ['/((?!api|_next|.*\\..*).*)'], -}; \ No newline at end of file +};