feat: expand supported locales in request configuration
This commit is contained in:
+26
-3
@@ -9,9 +9,32 @@ export default getRequestConfig(async ({ requestLocale }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use static imports for better compatibility
|
// Use static imports for better compatibility
|
||||||
const messages = locale === 'fr'
|
let messages;
|
||||||
? (await import('../locales/fr/common.json')).default
|
switch (locale) {
|
||||||
: (await import('../locales/en/common.json')).default;
|
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 {
|
return {
|
||||||
locale,
|
locale,
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import { defineRouting } from 'next-intl/routing';
|
import { defineRouting } from 'next-intl/routing';
|
||||||
|
|
||||||
export const routing = defineRouting({
|
export const routing = defineRouting({
|
||||||
locales: ['en', 'fr'],
|
locales: ['en', 'fr', 'de', 'es', 'it', 'ja', 'nl', 'pt'],
|
||||||
defaultLocale: 'en',
|
defaultLocale: 'en',
|
||||||
localePrefix: 'never'
|
localePrefix: 'never'
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user