Completes full internationalization coverage for the webmail application with enhanced language support: - Replace all remaining hardcoded English strings with translation keys - Add timezone auto-detection to prevent hydration mismatches - Enable instant client-side language switching without page reload - Add 60+ new translation keys in English and French locales - Improve language switcher component with proper state management - Add health check endpoint for container orchestration All user-facing text now supports English and French with no hardcoded fallbacks, providing a fully localized experience.
22 lines
606 B
TypeScript
22 lines
606 B
TypeScript
import { getRequestConfig } from 'next-intl/server';
|
|
import { routing, type Locale } from './routing';
|
|
|
|
export default getRequestConfig(async ({ requestLocale }) => {
|
|
let locale = await requestLocale;
|
|
|
|
if (!locale || !routing.locales.includes(locale as Locale)) {
|
|
locale = routing.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()
|
|
};
|
|
}); |