Closed rezaaa closed 11 months ago
That's related to how the locale is resolved by default: we're extracting the Accept-Language
header and trying to find a locale (within the locales
option) that matches. If one is found, this locale is used, and defaultLocale
isn't - the latter is only used when we cannot find any matching locale with the Accept-Language
header.
You can override this logic using the resolveLocaleFromRequest
option: https://next-international.vercel.app/docs/app-middleware-configuration#override-the-users-locale-resolution
In your case, you'll likely want to return "fa"
, if you always want your users to use this locale by default, instead of using their preferred one if available.
This is my middleware, and my defaultLocale is "fa" but it doesn't work and uses the en as the default when I delete en or change the en to another language like fr, the default locale works!