Files
jmap-webmail/i18n/request.ts
T
Matthieu MALVACHE 3fc8ccf116 feat(i18n): expand language support from 3 to 8 languages
Add support for Spanish, Italian, German, Dutch, and Portuguese with complete translations for all features including identity management, newsletter unsubscribe, and accessibility improvements.

Changes:
- Add 5 new locale directories with full translations
- Update IntlProvider to load all 8 language message files
- Redesign language switcher from button group to dropdown for better scalability
- Update routing and request configuration to handle new locales
- Improve Select component with dir="auto" for RTL support
- Reorganize notification keys in translation files for consistency
- Update all documentation to reflect expanded language support
2026-01-08 22:12:13 +01:00

28 lines
1.0 KiB
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
: locale === 'ja' ? (await import('../locales/ja/common.json')).default
: locale === 'es' ? (await import('../locales/es/common.json')).default
: locale === 'it' ? (await import('../locales/it/common.json')).default
: locale === 'de' ? (await import('../locales/de/common.json')).default
: locale === 'nl' ? (await import('../locales/nl/common.json')).default
: locale === 'pt' ? (await import('../locales/pt/common.json')).default
: (await import('../locales/en/common.json')).default;
return {
locale,
messages,
timeZone: 'Europe/Paris',
now: new Date()
};
});