next-intl 3.5.3 → 3.6.0-alpha.1
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.
|
@@ -10,7 +10,7 @@ var constants = require('../../shared/constants.js');
|
|
|
10
10
|
* See https://github.com/amannn/next-intl/issues/786.
|
|
11
11
|
*/
|
|
12
12
|
function syncLocaleCookie(pathname, locale, nextLocale) {
|
|
13
|
-
const isSwitchingLocale = nextLocale !== locale;
|
|
13
|
+
const isSwitchingLocale = nextLocale !== locale && nextLocale != null;
|
|
14
14
|
if (!isSwitchingLocale ||
|
|
15
15
|
// Theoretical case, we always have a pathname in a real app,
|
|
16
16
|
// only not when running e.g. in a simulated test environment
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{COOKIE_LOCALE_NAME as t,COOKIE_MAX_AGE as a,COOKIE_SAME_SITE as c}from"../../shared/constants.js";function o(o,n,e){if(!(e!==n)||!o)return;const i=window.location.pathname.replace(o,""),r=""!==i?i:"/";document.cookie="".concat(t,"=").concat(e,"; path=").concat(r,"; max-age=").concat(a,"; sameSite=").concat(c)}export{o as default};
|
|
1
|
+
import{COOKIE_LOCALE_NAME as t,COOKIE_MAX_AGE as a,COOKIE_SAME_SITE as c}from"../../shared/constants.js";function o(o,n,e){if(!(e!==n&&null!=e)||!o)return;const i=window.location.pathname.replace(o,""),r=""!==i?i:"/";document.cookie="".concat(t,"=").concat(e,"; path=").concat(r,"; max-age=").concat(a,"; sameSite=").concat(c)}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../shared/constants.js");exports.default=function(t,c,a){if(!(a!==c)||!t)return;const o=window.location.pathname.replace(t,""),n=""!==o?o:"/";document.cookie="".concat(e.COOKIE_LOCALE_NAME,"=").concat(a,"; path=").concat(n,"; max-age=").concat(e.COOKIE_MAX_AGE,"; sameSite=").concat(e.COOKIE_SAME_SITE)};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../shared/constants.js");exports.default=function(t,c,a){if(!(a!==c&&null!=a)||!t)return;const o=window.location.pathname.replace(t,""),n=""!==o?o:"/";document.cookie="".concat(e.COOKIE_LOCALE_NAME,"=").concat(a,"; path=").concat(n,"; max-age=").concat(e.COOKIE_MAX_AGE,"; sameSite=").concat(e.COOKIE_SAME_SITE)};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intl",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0-alpha.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Jan Amann <jan@amann.work>",
|
|
6
6
|
"funding": [
|
|
@@ -16,16 +16,6 @@
|
|
|
16
16
|
"type": "git",
|
|
17
17
|
"url": "https://github.com/amannn/next-intl"
|
|
18
18
|
},
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "rm -rf dist && rollup -c",
|
|
21
|
-
"test": "TZ=Europe/Berlin vitest",
|
|
22
|
-
"lint": "pnpm run lint:source && pnpm run lint:package",
|
|
23
|
-
"lint:source": "eslint src test && tsc --noEmit",
|
|
24
|
-
"lint:package": "publint && attw --pack",
|
|
25
|
-
"prepublishOnly": "CI=true turbo test && turbo lint && turbo build && cp ../../README.md .",
|
|
26
|
-
"postpublish": "git checkout . && rm ./README.md",
|
|
27
|
-
"size": "size-limit"
|
|
28
|
-
},
|
|
29
19
|
"main": "./dist/index.react-client.js",
|
|
30
20
|
"module": "./dist/esm/index.react-client.js",
|
|
31
21
|
"typings": "./dist/types/src/index.react-client.d.ts",
|
|
@@ -82,7 +72,7 @@
|
|
|
82
72
|
"dependencies": {
|
|
83
73
|
"@formatjs/intl-localematcher": "^0.2.32",
|
|
84
74
|
"negotiator": "^0.6.3",
|
|
85
|
-
"use-intl": "
|
|
75
|
+
"use-intl": "3.6.0-alpha.1"
|
|
86
76
|
},
|
|
87
77
|
"peerDependencies": {
|
|
88
78
|
"next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
|
@@ -114,19 +104,19 @@
|
|
|
114
104
|
"size-limit": [
|
|
115
105
|
{
|
|
116
106
|
"path": "dist/production/index.react-client.js",
|
|
117
|
-
"limit": "12.
|
|
107
|
+
"limit": "12.99 KB"
|
|
118
108
|
},
|
|
119
109
|
{
|
|
120
110
|
"path": "dist/production/index.react-server.js",
|
|
121
|
-
"limit": "
|
|
111
|
+
"limit": "13.75 KB"
|
|
122
112
|
},
|
|
123
113
|
{
|
|
124
114
|
"path": "dist/production/navigation.react-client.js",
|
|
125
|
-
"limit": "2.
|
|
115
|
+
"limit": "2.84 KB"
|
|
126
116
|
},
|
|
127
117
|
{
|
|
128
118
|
"path": "dist/production/navigation.react-server.js",
|
|
129
|
-
"limit": "2.
|
|
119
|
+
"limit": "2.95 KB"
|
|
130
120
|
},
|
|
131
121
|
{
|
|
132
122
|
"path": "dist/production/server.react-client.js",
|
|
@@ -134,12 +124,19 @@
|
|
|
134
124
|
},
|
|
135
125
|
{
|
|
136
126
|
"path": "dist/production/server.react-server.js",
|
|
137
|
-
"limit": "12.
|
|
127
|
+
"limit": "12.945 KB"
|
|
138
128
|
},
|
|
139
129
|
{
|
|
140
130
|
"path": "dist/production/middleware.js",
|
|
141
131
|
"limit": "5.81 KB"
|
|
142
132
|
}
|
|
143
133
|
],
|
|
144
|
-
"
|
|
145
|
-
|
|
134
|
+
"scripts": {
|
|
135
|
+
"build": "rm -rf dist && rollup -c",
|
|
136
|
+
"test": "TZ=Europe/Berlin vitest",
|
|
137
|
+
"lint": "pnpm run lint:source && pnpm run lint:package",
|
|
138
|
+
"lint:source": "eslint src test && tsc --noEmit",
|
|
139
|
+
"lint:package": "publint && attw --pack",
|
|
140
|
+
"size": "size-limit"
|
|
141
|
+
}
|
|
142
|
+
}
|