i18n.js 421 B

1234567891011121314
  1. import { getRequestConfig } from 'next-intl/server';
  2. import { notFound } from 'next/navigation';
  3. // Can be imported from a shared config
  4. const locales = ['en', 'ja', 'ko'];
  5. export default getRequestConfig(async ({ locale }) => {
  6. // Validate that the incoming `locale` parameter is valid
  7. if (!locales.includes(locale)) notFound();
  8. return {
  9. messages: (await import(`./locales/${locale}.json`)).default
  10. };
  11. });