mirror of
https://github.com/Luchexx/wacrm.git
synced 2026-11-02 09:19:51 +00:00
20 lines
543 B
TypeScript
20 lines
543 B
TypeScript
import { getRequestConfig } from 'next-intl/server';
|
|
|
|
export default getRequestConfig(async () => {
|
|
// Read the locale from the environment, defaulting to 'en'
|
|
const locale = process.env.NEXT_PUBLIC_APP_LOCALE || 'en';
|
|
|
|
let messages;
|
|
try {
|
|
messages = (await import(`../../messages/${locale}.json`)).default;
|
|
} catch (error) {
|
|
// Fallback to English if the dictionary for the requested locale doesn't exist yet
|
|
messages = (await import(`../../messages/en.json`)).default;
|
|
}
|
|
|
|
return {
|
|
locale,
|
|
messages
|
|
};
|
|
});
|