npm next-i18next 16.2.0
v16.2.0

4 hours ago
  • App Router: the proxy only writes the language cookie when the language changed — every response used to re-set the cookie: internal-mode rewrites on every request, the default and hideDefaultLocale redirects, and the referer branch on every navigation from a locale-prefixed page. Next merges a cookie set in middleware into the request's mutable cookies and treats any modified cookie as a revalidation, so every Server Action (its POST carries the page as referer) made the client router drop its cache and refetch the page, resetting remounted forms along the way. The write is now skipped when the incoming cookie already holds the resolved language. Trade-off: the cookie's maxAge is refreshed only on change. #2346
  • App Router: persistCookie and cookieOptionspersistCookie: false makes the proxy read the language cookie without ever writing it, for apps where another system owns it. cookieOptions (domain, secure, sameSite, path, maxAge) is applied on top of the defaults when the proxy does write, and useChangeLanguage(cookieName?, cookieOptions?) accepts the same options so both writers agree on the cookie's scope. #2346

Don't miss a new next-i18next release

NewReleases is sending notifications on new releases.