Files
SRCmail/i18n/request.ts
T
Matthieu MALVACHEandMatthieu MALVACHE cf21a84263 Initial release: JMAP Webmail Client
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)
2025-12-10 17:54:22 +01:00

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()
};
});