feat(i18n): setup next-intl core config and translation dictionaries

This commit is contained in:
Poyraz
2026-06-27 14:42:40 +03:00
parent 6d2ecbc14f
commit 968ebb33c5
19 changed files with 275 additions and 91 deletions
+15
View File
@@ -0,0 +1,15 @@
import {getRequestConfig} from "next-intl/server";
import {routing} from "./routing";
export default getRequestConfig(async ({requestLocale}) => {
let locale = await requestLocale;
if (!locale || !routing.locales.includes(locale as "tr" | "en")) {
locale = routing.defaultLocale;
}
return {
locale,
messages: (await import(`../messages/${locale}.json`)).default
};
});
+10
View File
@@ -0,0 +1,10 @@
import {defineRouting} from "next-intl/routing";
import {createNavigation} from "next-intl/navigation";
export const routing = defineRouting({
locales: ["tr", "en"],
defaultLocale: "tr",
});
export const {Link, redirect, usePathname, useRouter, getPathname} =
createNavigation(routing);