diff --git a/i18n.ts b/i18n.ts deleted file mode 100644 index 0d4c315..0000000 --- a/i18n.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { getRequestConfig } from 'next-intl/server'; - -export default getRequestConfig(async ({ locale }) => ({ - messages: (await import(`./messages/${locale}.json`)).default -})); \ No newline at end of file diff --git a/next-intl.config.ts b/next-intl.config.ts new file mode 100644 index 0000000..25996a4 --- /dev/null +++ b/next-intl.config.ts @@ -0,0 +1 @@ +export { default } from './src/i18n'; \ No newline at end of file diff --git a/src/i18n.ts b/src/i18n.ts new file mode 100644 index 0000000..10fd8f4 --- /dev/null +++ b/src/i18n.ts @@ -0,0 +1,12 @@ +import {notFound} from 'next/navigation'; +import {getRequestConfig} from 'next-intl/server'; + +const locales = ['en']; + +export default getRequestConfig(async ({locale}) => { + if (!locales.includes(locale as any)) notFound(); + + return { + messages: (await import(`../messages/${locale}.json`)).default + }; +}); \ No newline at end of file