next-intl 3.25.2 → 3.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,7 @@ function useBasePathname(config) {
26
26
  const isPathnamePrefixed = utils.hasPathnamePrefixed(prefix, pathname);
27
27
  if (isPathnamePrefixed) {
28
28
  unlocalizedPathname = utils.unprefixPathname(pathname, prefix);
29
- } else if (config.localePrefix.mode === 'as-needed' && config.defaultLocale === locale && config.localePrefix.prefixes) {
29
+ } else if (config.localePrefix.mode === 'as-needed' && config.localePrefix.prefixes) {
30
30
  // Workaround for https://github.com/vercel/next.js/issues/73085
31
31
  const localeAsPrefix = utils.getLocaleAsPrefix(locale);
32
32
  if (utils.hasPathnamePrefixed(localeAsPrefix, pathname)) {
@@ -34,7 +34,7 @@ function useBasePathname(config) {
34
34
  }
35
35
  }
36
36
  return unlocalizedPathname;
37
- }, [config.defaultLocale, config.localePrefix, locale, pathname]);
37
+ }, [config.localePrefix, locale, pathname]);
38
38
  }
39
39
 
40
40
  exports.default = useBasePathname;
@@ -1 +1 @@
1
- import{usePathname as e}from"next/navigation";import{useMemo as r}from"react";import o from"../../react-client/useLocale.js";import{hasPathnamePrefixed as t,unprefixPathname as l,getLocalePrefix as a,getLocaleAsPrefix as i}from"../../shared/utils.js";function f(f){const c=e(),n=o();return r((()=>{if(!c)return c;let e=c;const r=a(n,f.localePrefix);if(t(r,c))e=l(c,r);else if("as-needed"===f.localePrefix.mode&&f.defaultLocale===n&&f.localePrefix.prefixes){const r=i(n);t(r,c)&&(e=l(c,r))}return e}),[f.defaultLocale,f.localePrefix,n,c])}export{f as default};
1
+ import{usePathname as e}from"next/navigation";import{useMemo as r}from"react";import o from"../../react-client/useLocale.js";import{hasPathnamePrefixed as t,unprefixPathname as i,getLocalePrefix as f,getLocaleAsPrefix as l}from"../../shared/utils.js";function a(a){const n=e(),c=o();return r((()=>{if(!n)return n;let e=n;const r=f(c,a.localePrefix);if(t(r,n))e=i(n,r);else if("as-needed"===a.localePrefix.mode&&a.localePrefix.prefixes){const r=l(c);t(r,n)&&(e=i(n,r))}return e}),[a.localePrefix,c,n])}export{a as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),r=require("react"),a=require("../../react-client/useLocale.js"),t=require("../../shared/utils.js");exports.default=function(i){const l=e.usePathname(),n=a.default();return r.useMemo((()=>{if(!l)return l;let e=l;const r=t.getLocalePrefix(n,i.localePrefix);if(t.hasPathnamePrefixed(r,l))e=t.unprefixPathname(l,r);else if("as-needed"===i.localePrefix.mode&&i.defaultLocale===n&&i.localePrefix.prefixes){const r=t.getLocaleAsPrefix(n);t.hasPathnamePrefixed(r,l)&&(e=t.unprefixPathname(l,r))}return e}),[i.defaultLocale,i.localePrefix,n,l])};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),r=require("react"),a=require("../../react-client/useLocale.js"),t=require("../../shared/utils.js");exports.default=function(i){const n=e.usePathname(),s=a.default();return r.useMemo((()=>{if(!n)return n;let e=n;const r=t.getLocalePrefix(s,i.localePrefix);if(t.hasPathnamePrefixed(r,n))e=t.unprefixPathname(n,r);else if("as-needed"===i.localePrefix.mode&&i.localePrefix.prefixes){const r=t.getLocaleAsPrefix(s);t.hasPathnamePrefixed(r,n)&&(e=t.unprefixPathname(n,r))}return e}),[i.localePrefix,s,n])};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-intl",
3
- "version": "3.25.2",
3
+ "version": "3.26.0",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "funding": [
@@ -88,11 +88,11 @@
88
88
  "dependencies": {
89
89
  "@formatjs/intl-localematcher": "^0.5.4",
90
90
  "negotiator": "^1.0.0",
91
- "use-intl": "^3.25.2"
91
+ "use-intl": "^3.26.0"
92
92
  },
93
93
  "peerDependencies": {
94
94
  "next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
95
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0"
95
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0"
96
96
  },
97
- "gitHead": "cdcff43e0a606bc9990623d819de9c37fea895a4"
97
+ "gitHead": "a08bf13e51994775a4ed728b93e8131e42d6218b"
98
98
  }