A modern, privacy-focused webmail client built with Next.js and the JMAP protocol. Designed for Stalwart Mail Server. Features: - Full email operations (compose, reply, forward, threading) - Real-time push notifications - Dark/light theme support - Mobile responsive design - Keyboard shortcuts - Drag-and-drop organization - i18n (English/French) - Security-first (external content blocked, HTML sanitization)
27 lines
808 B
TypeScript
27 lines
808 B
TypeScript
import { getRequestConfig } from 'next-intl/server';
|
|
|
|
export const locales = ['en', 'fr'] as const;
|
|
export type Locale = (typeof locales)[number];
|
|
export const defaultLocale: Locale = 'en';
|
|
|
|
export default getRequestConfig(async ({ requestLocale }) => {
|
|
// Get the locale from the request or use default
|
|
let locale = await requestLocale || defaultLocale;
|
|
|
|
// Validate that the incoming `locale` parameter is valid
|
|
if (!(locales as readonly string[]).includes(locale)) {
|
|
locale = defaultLocale;
|
|
}
|
|
|
|
// Use static imports for better compatibility
|
|
const messages = locale === 'fr'
|
|
? (await import('../locales/fr/common.json')).default
|
|
: (await import('../locales/en/common.json')).default;
|
|
|
|
return {
|
|
locale,
|
|
messages,
|
|
timeZone: 'Europe/Paris',
|
|
now: new Date()
|
|
};
|
|
}); |