Set localePrefix prop based on domains #1030
-
Hi! export default createMiddleware({
locales: ['en-US', 'fr-FR', 'en-GB', 'de-DE', 'it-IT']
domains: [
{
domain: 'www.mywebsite.it',
defaultLocale: 'it-IT',
localePrefix: 'as-needed',
locales: ['it-IT'],
},
{
domain: 'www.mywebsite.com',
defaultLocale: 'en-US',
localePrefix: 'always',
locales: ['en-US', 'fr-FR', 'en-GB', 'de-DE'],
},
],
localeDetection: true,
}); Is there a way to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I managed to get this result using @amannn is that the supposed behaviour or is it just an 'involuntary-feature' that might change unpredictably with updates? |
Beta Was this translation helpful? Give feedback.
Hey, thanks for the question! Currently this is undocumented behavior, I'm not sure what consequences this has. And yes, it could break with updates.
You can open a feature request though if this use case is relevant for you!