I have the following NextJS setup and localeDetection works like a charm on localhost, both on the dev server and when build.
But when deployed to Netlify the language detection is not working and the 307 redirect to /en never happens.
i18n: {
locales: ['en', 'fr'],
defaultLocale: 'fr',
localeDetection: true,
},
Language header passed to the server:
Accept-Language: en
Looking back in time it seems that the issue was related to missconfiguratuon in CloudFlare.