next-intl 3.3.3 → 3.4.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.
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var headers = require('next/headers');
|
|
6
|
+
var navigation = require('next/navigation');
|
|
6
7
|
var React = require('react');
|
|
7
8
|
var constants = require('../../shared/constants.js');
|
|
8
9
|
|
|
@@ -20,7 +21,10 @@ function getLocaleFromHeaderImpl() {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
if (!locale) {
|
|
23
|
-
|
|
24
|
+
{
|
|
25
|
+
console.error("Unable to find `next-intl` locale because the middleware didn't run on this request. See https://next-intl-docs.vercel.app/docs/routing/middleware#unable-to-find-locale. The `notFound()` function will be called as a result.");
|
|
26
|
+
}
|
|
27
|
+
navigation.notFound();
|
|
24
28
|
}
|
|
25
29
|
return locale;
|
|
26
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{headers as
|
|
1
|
+
import{headers as t}from"next/headers";import{notFound as e}from"next/navigation";import{cache as n}from"react";import{HEADER_LOCALE_NAME as o}from"../../shared/constants.js";const r=n((function(){let n;try{n=t().get(o)}catch(t){throw t instanceof Error&&"DYNAMIC_SERVER_USAGE"===t.digest?new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `unstable_setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router-server-components#static-rendering",{cause:t}):t}return n||e(),n}));const i=n((function(){return{locale:void 0}}));function s(t){i().locale=t}function a(){return i().locale||r()}export{a as getRequestLocale,s as setRequestLocale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("next/navigation"),n=require("react"),r=require("../../shared/constants.js");const o=n.cache((function(){let n;try{n=e.headers().get(r.HEADER_LOCALE_NAME)}catch(e){throw e instanceof Error&&"DYNAMIC_SERVER_USAGE"===e.digest?new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `unstable_setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router-server-components#static-rendering",{cause:e}):e}return n||t.notFound(),n}));const s=n.cache((function(){return{locale:void 0}}));exports.getRequestLocale=function(){return s().locale||o()},exports.setRequestLocale=function(e){s().locale=e};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intl",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Jan Amann <jan@amann.work>",
|
|
6
6
|
"funding": [
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@formatjs/intl-localematcher": "^0.2.32",
|
|
82
82
|
"negotiator": "^0.6.3",
|
|
83
|
-
"use-intl": "^3.
|
|
83
|
+
"use-intl": "^3.4.0"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
|
@@ -137,5 +137,5 @@
|
|
|
137
137
|
"limit": "5.8 KB"
|
|
138
138
|
}
|
|
139
139
|
],
|
|
140
|
-
"gitHead": "
|
|
140
|
+
"gitHead": "7f87617f8db3f4750a048f16f61aaa1af85e8979"
|
|
141
141
|
}
|