chore: handle internal docs link redirection for internationalization
This commit is contained in:
parent
07ad39871f
commit
7b9b7a0dd7
@ -33,7 +33,7 @@ export default async function middleware(req: NextRequest) {
|
|||||||
|
|
||||||
// Handle internal docs link redirection for internationalization
|
// Handle internal docs link redirection for internationalization
|
||||||
// Check if this is a docs page without locale prefix
|
// Check if this is a docs page without locale prefix
|
||||||
if (nextUrl.pathname.startsWith('/docs/')) {
|
if (nextUrl.pathname.startsWith('/docs/') || nextUrl.pathname === '/docs') {
|
||||||
// Get the user's preferred locale from cookie
|
// Get the user's preferred locale from cookie
|
||||||
const localeCookie = req.cookies.get(LOCALE_COOKIE_NAME);
|
const localeCookie = req.cookies.get(LOCALE_COOKIE_NAME);
|
||||||
const preferredLocale = localeCookie?.value;
|
const preferredLocale = localeCookie?.value;
|
||||||
|
Loading…
Reference in New Issue
Block a user