diff --git a/.env.local.example b/.env.local.example
index f173197..a83e3ea 100644
--- a/.env.local.example
+++ b/.env.local.example
@@ -42,7 +42,7 @@ META_APP_SECRET=your-meta-app-secret
# or a background worker that has no incoming request.
NEXT_PUBLIC_SITE_URL=https://crm.example.com
-# Default language locale (e.g. en, es)
+# Default language locale (e.g. en)
NEXT_PUBLIC_APP_LOCALE=en
# ============================================================
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 2565f16..4a8c05a 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -108,7 +108,7 @@ export default async function RootLayout({
/>
-
+
{children}
diff --git a/src/i18n/request.ts b/src/i18n/request.ts
index 63a3015..20a9318 100644
--- a/src/i18n/request.ts
+++ b/src/i18n/request.ts
@@ -4,8 +4,16 @@ 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: (await import(`../../messages/${locale}.json`)).default
+ messages
};
});