Implement complete multi-language support with Romanian/English
- Added next-intl for internationalization with Romanian as default locale - Restructured app directory with [locale] routing (/ro, /en) - Created comprehensive translation files for both languages - Fixed Next.js 15 async params compatibility in layout components - Updated all components to use proper i18n hooks and translations - Configured middleware for locale routing and fallbacks - Fixed FloatingChat component translation array handling - Restored complete home page with internationalized content - Fixed Material-UI Slide component prop error (mountOnExit → unmountOnExit) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
25
middleware-test.ts
Normal file
25
middleware-test.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import type { NextRequest } from 'next/server'
|
||||
|
||||
export async function middleware(request: NextRequest) {
|
||||
console.log('Middleware called for:', request.nextUrl.pathname)
|
||||
|
||||
if (request.nextUrl.pathname === '/') {
|
||||
console.log('Redirecting / to /ro')
|
||||
return NextResponse.redirect(new URL('/ro', request.url))
|
||||
}
|
||||
|
||||
if (request.nextUrl.pathname.startsWith('/ro') || request.nextUrl.pathname.startsWith('/en')) {
|
||||
console.log('Allowing locale route:', request.nextUrl.pathname)
|
||||
return NextResponse.next()
|
||||
}
|
||||
|
||||
console.log('Default behavior for:', request.nextUrl.pathname)
|
||||
return NextResponse.next()
|
||||
}
|
||||
|
||||
export const config = {
|
||||
matcher: [
|
||||
'/((?!api|_next|_vercel|.*\\..*).*)',
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user