-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
43 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { loadEnvConfig } = require("@next/env"); | ||
const withNextIntl = require("next-intl/plugin")(); | ||
|
||
loadEnvConfig(process.cwd()); | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const config = { | ||
poweredByHeader: false, | ||
logging: { | ||
fetches: { | ||
fullUrl: process.env.NODE_ENV === "production", | ||
}, | ||
}, | ||
}; | ||
|
||
module.exports = withNextIntl({ ...config }); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
import createIntlMiddleware from "next-intl/middleware"; | ||
import type { NextRequest } from "next/server"; | ||
import { LOCALES } from "./locales"; | ||
import { NextRequest } from "next/server"; | ||
|
||
export const LOCALES = ["de", "en"] as const; | ||
export const X_URL = "x-url"; | ||
|
||
export default async function middleware(request: NextRequest) { | ||
// Step 2: Create and call the next-intl middleware (example) | ||
const handleI18nRouting = createIntlMiddleware({ | ||
locales: LOCALES, | ||
defaultLocale: "de", | ||
localePrefix: "never", | ||
defaultLocale: LOCALES[0], | ||
localeDetection: true, | ||
}); | ||
const response = handleI18nRouting(request); | ||
|
||
response.headers.set("x-url", request.url); | ||
response.headers.set(X_URL, request.url); | ||
|
||
return response; | ||
} | ||
|
||
export const config = { | ||
matcher: ["/((?!api|_next|_vercel|.*\\..*).*)"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { createSharedPathnamesNavigation } from "next-intl/navigation"; | ||
import { LOCALES } from "./locales"; | ||
import { LOCALES } from "./middleware"; | ||
|
||
export const { Link, redirect, usePathname, useRouter } = | ||
createSharedPathnamesNavigation({ locales: LOCALES }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters