Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions apps/docs/middleware.ts → apps/docs/proxy.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,9 +45,10 @@ function getPreferredLanguage(request: NextRequest): string {
}

/**
* Middleware for automatic language detection and redirection
* Proxy (Next `proxy` file convention) for automatic language detection and
* redirection
*
* This middleware:
* This proxy:
* - Detects the user's preferred language from browser settings or cookies
* - Redirects users to the appropriate localized version
* - For the default language (en): keeps URL as "/" (with internal rewrite)
Expand All@@ -56,7 +57,7 @@ function getPreferredLanguage(request: NextRequest): string {
* The docs are English-only by decision (2026-07); the i18n plumbing stays so a
* future language only needs entries in lib/i18n.ts and content, not new routing.
*/
export default function middleware(request: NextRequest) {
export default function proxy(request: NextRequest) {
const { pathname } = request.nextUrl;

// Check if the pathname already has a locale
Expand Down
Loading