github i18next/next-i18next v16.4.4

5 hours ago
  • App Router: routes that start with a language code are no longer taken for a locale - with localeInPath, the proxy matched the first path segment like an Accept-Language value, which also accepts a prefix. With supportedLngs: ['en', 'it'] a route like /it-jobs counted as the locale it, so it was served without a redirect and app/[lng] got lng = 'it-jobs' instead of /en/it-jobs being rendered (the same for /my-account with my supported, and a referer like that could set the cookie). The first segment now counts as a locale only if it is a supported code or shaped like a language tag (a 2-3 letter language with an optional region such as en-gb or es-419, or script and region such as zh-Hant-TW). A tag that resolves to a supported code is moved to that code: /en-gb/about redirects to /en/about, and with nonExplicitSupportedLngs and regional codes /en/about redirects to /en-US/about. hideDefaultLocale sends it to the clean URL, and localeInPath: 'internal' rewrites instead of redirecting. Anything else is a normal route and gets the locale prefix. Exact codes are served as before. Thanks @Pharex38 (#2352)

Don't miss a new next-i18next release

NewReleases is sending notifications on new releases.