next-intl 3.18.0-canary.0 → 3.18.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.
|
@@ -39,8 +39,16 @@ async function receiveRuntimeConfigImpl(getConfig, localeOverride) {
|
|
|
39
39
|
if (result instanceof Promise) {
|
|
40
40
|
result = await result;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
{
|
|
43
|
+
if (hasReadLocale) {
|
|
44
|
+
if (result.locale) {
|
|
45
|
+
console.error("\nYou've read the `locale` param that was passed to `getRequestConfig` but have also returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n");
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
if (!result.locale) {
|
|
49
|
+
console.error("\nYou haven't read the `locale` param that was passed to `getRequestConfig` and also haven't returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
44
52
|
}
|
|
45
53
|
return {
|
|
46
54
|
...result,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cache as t}from"react";import{_createIntlFormatters as e,_createCache as o,initializeConfig as n}from"use-intl/core";import{getRequestLocale as r}from"./RequestLocale.js";import a from"next-intl/config";const s=t((function(){return new Date}));const i=t((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const
|
|
1
|
+
import{cache as t}from"react";import{_createIntlFormatters as e,_createCache as o,initializeConfig as n}from"use-intl/core";import{getRequestLocale as r}from"./RequestLocale.js";import a from"next-intl/config";const s=t((function(){return new Date}));const i=t((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const l=t((async function(t,e){let o=!1;const n={get locale(){return o=!0,e||r()}};let a=t(n);return a instanceof Promise&&(a=await a),o?a.locale&&console.error("\nYou've read the `locale` param that was passed to `getRequestConfig` but have also returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n"):a.locale||console.error("\nYou haven't read the `locale` param that was passed to `getRequestConfig` and also haven't returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n"),{...a,locale:a.locale||n.locale,now:a.now||s(),timeZone:a.timeZone||i()}})),c=t(e),u=t(o);const p=t((async function(t){const e=await l(a,t);return{...n(e),_formatters:c(u())}}));export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("use-intl/core"),n=require("./RequestLocale.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("use-intl/core"),n=require("./RequestLocale.js");function c(e){return e&&e.__esModule?e:{default:e}}var r=c(require("next-intl/config"));const o=e.cache((function(){return new Date}));const a=e.cache((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const i=e.cache((async function(e,t){const c={get locale(){return t||n.getRequestLocale()}};let r=e(c);return r instanceof Promise&&(r=await r),{...r,locale:r.locale||c.locale,now:r.now||o(),timeZone:r.timeZone||a()}})),u=e.cache(t._createIntlFormatters),s=e.cache(t._createCache);const l=e.cache((async function(e){const n=await i(r.default,e);return{...t.initializeConfig(n),_formatters:u(s())}}));exports.default=l;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intl",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Jan Amann <jan@amann.work>",
|
|
6
6
|
"funding": [
|
|
@@ -87,11 +87,11 @@
|
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@formatjs/intl-localematcher": "^0.5.4",
|
|
89
89
|
"negotiator": "^0.6.3",
|
|
90
|
-
"use-intl": "^3.18.
|
|
90
|
+
"use-intl": "^3.18.1"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
93
|
"next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
|
94
94
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "80ec17a8fb7873fa1f7c5416c74a535573f58d97"
|
|
97
97
|
}
|