Add next-intl to internationalize our project

This commit is contained in:
2026-02-03 15:11:59 +01:00
parent a073665dc4
commit 85b618836b
25 changed files with 1103 additions and 180 deletions

16
i18n/request.ts Normal file
View File

@@ -0,0 +1,16 @@
import { hasLocale } from "next-intl";
import { getRequestConfig } from "next-intl/server";
import { routing } from "./routing";
export default getRequestConfig(async ({ requestLocale }) => {
// Typically corresponds to the `[locale]` segment
const requested = await requestLocale;
const locale = hasLocale(routing.locales, requested)
? requested
: routing.defaultLocale;
return {
locale,
messages: (await import(`../messages/${locale}.json`)).default,
};
});