Next.js Discord

Discord Forum

i18n localization localeDetection not working on vercel

Unanswered
Keyhole wasp posted this in #help-forum
Open in Discord
Keyhole waspOP
I have a site with this in this config
  i18n: {
    locales: ['en-US', 'en-GB', 'en-AU', 'fr-FR', 'de-DE' /*, 'pt-BR', 'zh-TW', 'ko-KR', 'es-ES', 'it-IT', 'es-MX'*/],
    defaultLocale: 'en-US',
  },


when using yarn dev or yarn build && yarn start locally it works fine when i set my browsers language settings to prioritize some other locale

when i deploy it to vercel it does not act this way.

I checked the the Accept-Language header is being sent in both instances.
accept-language: de


when on vercel the response headers gives me this:
x-matched-path: /en-US


this is the default region, though i dunno what the browser does with header (i think nothing)

0 Replies