import {getRequestConfig} from 'next-intl/server';

// Can be imported from a shared config
export const locales = ['ro', 'en'];

export default getRequestConfig(async ({locale}) => {
  // Ensure locale has a value, default to 'ro' if undefined
  const validLocale = locale || 'ro';

  return {
    locale: validLocale,
    messages: (await import(`./messages/${validLocale}.json`)).default
  };
});