-
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
1 parent
fbabca8
commit 7da65ce
Showing
10 changed files
with
212 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
const withNextIntl = require("next-intl/plugin")(); | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
|
||
module.exports = nextConfig; | ||
module.exports = withNextIntl(nextConfig); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
}, | ||
"dependencies": { | ||
"next": "14.0.4", | ||
"next-intl": "^3.4.2", | ||
"react": "^18", | ||
"react-dom": "^18" | ||
}, | ||
|
File renamed without changes.
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
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,15 @@ | ||
import { notFound } from "next/navigation"; | ||
import { getRequestConfig } from "next-intl/server"; | ||
|
||
export const locales = ["ro", "en"]; | ||
|
||
export default getRequestConfig(async ({ locale }) => { | ||
// Validate that the incoming `locale` parameter is valid | ||
if (!locales.includes(locale as any)) { | ||
notFound(); | ||
} | ||
|
||
return { | ||
messages: (await import(`./messages/${locale}.json`)).default, | ||
}; | ||
}); |
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 @@ | ||
{ | ||
"Index": { | ||
"getStarted": "Get started by editing", | ||
"by": "By" | ||
} | ||
} |
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 @@ | ||
{ | ||
"Index": { | ||
"getStarted": "Începe prin a edita fișierul", | ||
"by": "De" | ||
} | ||
} |
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,15 @@ | ||
import createMiddleware from "next-intl/middleware"; | ||
import { locales } from "./i18n"; | ||
|
||
export default createMiddleware({ | ||
// A list of all locales that are supported | ||
locales, | ||
|
||
// Used when no locale matches | ||
defaultLocale: "ro", | ||
}); | ||
|
||
export const config = { | ||
// Match only internationalized pathnames | ||
matcher: ["/", "/(en|ro)/:path*"], | ||
}; |