feat: expand supported locales in request configuration

This commit is contained in:
Linus Rath
2026-03-14 19:03:37 +01:00
parent d5404de224
commit d1478fa46b
2 changed files with 27 additions and 4 deletions
+26 -3
View File
@@ -9,9 +9,32 @@ export default getRequestConfig(async ({ requestLocale }) => {
}
// Use static imports for better compatibility
const messages = locale === 'fr'
? (await import('../locales/fr/common.json')).default
: (await import('../locales/en/common.json')).default;
let messages;
switch (locale) {
case 'fr':
messages = (await import('../locales/fr/common.json')).default;
break;
case 'de':
messages = (await import('../locales/de/common.json')).default;
break;
case 'es':
messages = (await import('../locales/es/common.json')).default;
break;
case 'it':
messages = (await import('../locales/it/common.json')).default;
break;
case 'ja':
messages = (await import('../locales/ja/common.json')).default;
break;
case 'nl':
messages = (await import('../locales/nl/common.json')).default;
break;
case 'pt':
messages = (await import('../locales/pt/common.json')).default;
break;
default:
messages = (await import('../locales/en/common.json')).default;
}
return {
locale,
+1 -1
View File
@@ -1,7 +1,7 @@
import { defineRouting } from 'next-intl/routing';
export const routing = defineRouting({
locales: ['en', 'fr'],
locales: ['en', 'fr', 'de', 'es', 'it', 'ja', 'nl', 'pt'],
defaultLocale: 'en',
localePrefix: 'never'
});