diff --git a/src/config.ts b/src/config.ts index 5f14037..0a65fa2 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,4 +1,4 @@ -import { Pathnames } from 'next-intl'; + export const locales = ['en', 'ar'] as const; export const defaultLocale = 'ar'; // Set default to Arabic as current content is Arabic @@ -11,6 +11,6 @@ export const localePrefix = 'always'; // but useful if you plan to have separate pages later (e.g., /en/about vs /ar/about) export const pathnames = { '/': '/', -} satisfies Pathnames; +}; export type AppPathnames = keyof typeof pathnames; diff --git a/src/i18n.ts b/src/i18n.ts index 26cbd38..ba1b892 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -1,11 +1,5 @@ -import { getRequestConfig } from 'next-intl'; -import { notFound } from 'next/navigation'; + + import { locales } from './config'; -export default getRequestConfig(async ({ locale }) => { - if (!locales.includes(locale as any)) notFound(); - return { - messages: (await import(`../messages/${locale}.json`)).default, - }; -});