next-intl 3.23.4 → 3.24.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.
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ export default function UserProfile({user}) {
|
|
|
47
47
|
// en.json
|
|
48
48
|
{
|
|
49
49
|
"UserProfile": {
|
|
50
|
-
"title": "{
|
|
50
|
+
"title": "{firstName}'s profile",
|
|
51
51
|
"membership": "Member since {memberSince, date, short}",
|
|
52
52
|
"followers": "{count, plural, ↵
|
|
53
53
|
=0 {No followers yet} ↵
|
|
@@ -27,7 +27,7 @@ function BaseLink(_ref, ref) {
|
|
|
27
27
|
...rest
|
|
28
28
|
} = _ref;
|
|
29
29
|
const curLocale = useLocale.default();
|
|
30
|
-
const isChangingLocale = locale !== curLocale;
|
|
30
|
+
const isChangingLocale = locale != null && locale !== curLocale;
|
|
31
31
|
const linkLocale = locale || curLocale;
|
|
32
32
|
const host = useHost();
|
|
33
33
|
const finalHref =
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import o from"next/link";import{usePathname as t}from"next/navigation";import r,{forwardRef as n,useState as
|
|
2
|
+
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import o from"next/link";import{usePathname as t}from"next/navigation";import r,{forwardRef as n,useState as l,useEffect as i}from"react";import c from"../../react-client/useLocale.js";import a from"./syncLocaleCookie.js";function s(n,s){let{defaultLocale:p,href:f,locale:u,localeCookie:m,onClick:h,prefetch:d,unprefixed:k,...x}=n;const L=c(),g=null!=u&&u!==L,j=u||L,v=function(){const[e,o]=l();return i((()=>{o(window.location.host)}),[]),e}(),w=v&&k&&(k.domains[v]===j||!Object.keys(k.domains).includes(v)&&L===p&&!u)?k.pathname:f,C=t();return g&&(d&&console.error("The `prefetch` prop is currently not supported when using the `locale` prop on `Link` to switch the locale.`"),d=!1),r.createElement(o,e({ref:s,href:w,hrefLang:g?u:void 0,onClick:function(e){a(m,C,L,u),h&&h(e)},prefetch:d},x))}var p=n(s);export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=require("next/link"),r=require("next/navigation"),n=require("react"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=require("next/link"),r=require("next/navigation"),n=require("react"),u=require("../../react-client/useLocale.js"),a=require("./syncLocaleCookie.js");function l(e){return e&&e.__esModule?e:{default:e}}var o=l(t),i=l(n);function c(t,l){let{defaultLocale:c,href:f,locale:s,localeCookie:d,onClick:p,prefetch:h,unprefixed:v,...k}=t;const q=u.default(),x=null!=s&&s!==q,_=s||q,j=function(){const[e,t]=n.useState();return n.useEffect((()=>{t(window.location.host)}),[]),e}(),m=j&&v&&(v.domains[j]===_||!Object.keys(v.domains).includes(j)&&q===c&&!s)?v.pathname:f,C=r.usePathname();return x&&(h=!1),i.default.createElement(o.default,e.extends({ref:l,href:m,hrefLang:x?s:void 0,onClick:function(e){a.default(d,C,q,s),p&&p(e)},prefetch:h},k))}var f=n.forwardRef(c);exports.default=f;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intl",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.24.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.
|
|
91
|
+
"use-intl": "^3.24.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"
|
|
95
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "fdcfa24aa7da58bb84c79692a98b0c4e163f87dd"
|
|
98
98
|
}
|