Working state: Serbian at root (/), English at /en, proper i18n structure

This commit is contained in:
Neo
2026-03-04 08:48:13 +00:00
commit cbb49ba64f
51 changed files with 10050 additions and 0 deletions

15
src/i18n/index.ts Normal file
View File

@@ -0,0 +1,15 @@
import { getRequestConfig } from "next-intl/server";
import { notFound } from "next/navigation";
export const locales = ["en", "sr"] as const;
export type Locale = (typeof locales)[number];
export default getRequestConfig(async ({ locale }) => {
const currentLocale = locale || "sr";
if (!locales.includes(currentLocale as Locale)) notFound();
return {
locale: currentLocale,
messages: (await import(`./messages/${currentLocale}.json`)).default,
};
});