mirror of
https://github.com/zen-browser/www.git
synced 2025-07-10 10:15:31 +02:00
feat: Update i18n configuration, refactor getRequestConfig, and improve language support
This commit is contained in:
parent
5779ea88ef
commit
27b23e8336
3 changed files with 21 additions and 22 deletions
|
@ -1,22 +0,0 @@
|
|||
import createMiddleware from 'next-intl/middleware';
|
||||
import {NextRequest} from 'next/server';
|
||||
|
||||
export default async function middleware(request: NextRequest) {
|
||||
// Step 1: Use the incoming request (example)
|
||||
const defaultLocale = request.headers.get('x-your-custom-locale') || 'en';
|
||||
|
||||
// Step 2: Create and call the next-intl middleware (example)
|
||||
const handleI18nRouting = createMiddleware({
|
||||
locales: ['en', 'de'],
|
||||
defaultLocale,
|
||||
localePrefix: "always",
|
||||
});
|
||||
const response = handleI18nRouting(request);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
export const config = {
|
||||
// Match only internationalized pathnames
|
||||
matcher: ['/', '/(de|en)/:path*']
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue