You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGELOG.md
+12
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,18 @@
3
3
All notable changes to this project will be documented in this file.
4
4
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
6
+
## 3.25.3 (2024-11-26)
7
+
8
+
### Bug Fixes
9
+
10
+
* Follow-up for [#1573](https://github.com/amannn/next-intl/issues/1573) to also handle the case when a non-default locale is in use ([#1578](https://github.com/amannn/next-intl/issues/1578)) ([fd71741](https://github.com/amannn/next-intl/commit/fd7174179881a19e3573fceb9c6e903923644761)), closes [#1568](https://github.com/amannn/next-intl/issues/1568) – by @amannn
11
+
12
+
## 3.25.2 (2024-11-25)
13
+
14
+
### Bug Fixes
15
+
16
+
* Handle inconsistency in Next.js when using `usePathname` with custom prefixes, `localePrefix: 'as-needed'` and static rendering ([#1573](https://github.com/amannn/next-intl/issues/1573)) ([20fd0f0](https://github.com/amannn/next-intl/commit/20fd0f0015839357893bcd256ff880a98b01ea1f)) – by @amannn
Additionally, you should adapt your middleware matcher to detect [unprefixed pathnames](/docs/routing/middleware#matcher-no-prefix) for this routing strategy to work as expected.
86
+
**Important**: For this routing strategy to work as expected, you should additionally adapt your middleware matcher to detect [unprefixed pathnames](/docs/routing/middleware#matcher-no-prefix).
87
87
88
88
Note that if a superfluous locale prefix like `/en/about` is requested, the middleware will automatically redirect to the unprefixed version `/about`. This can be helpful in case you're redirecting from another locale and you want to update a potential cookie value first (e.g. [`<Link />`](/docs/routing/navigation#link) relies on this mechanism).
Copy file name to clipboardexpand all lines: docs/src/pages/docs/routing/middleware.mdx
+2-1
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,7 @@ This enables:
123
123
<Detailsid="matcher-avoid-hardcoding">
124
124
<summary>Can I avoid hardcoding the locales in the `matcher` config?</summary>
125
125
126
-
A [Next.js `matcher`](https://nextjs.org/docs/app/building-your-application/routing/middleware#matcher) needs to be statically analyzable, therefore you can't use variables to generate this value dynamically. However, you can implement the matcher dynamically instead:
126
+
A [Next.js `matcher`](https://nextjs.org/docs/app/building-your-application/routing/middleware#matcher) needs to be statically analyzable, therefore you can't use variables to generate this value. However, you can alternatively implement a programmatic condition in the middleware:
Note however that the `locales` argument for the middleware is still mandatory. If you need to fetch the available locales at runtime, you can provide the routing configuration for the middleware [dynamically per request](/docs/routing/middleware#composing-other-middlewares).
@@ -324,7 +325,7 @@ function UserProfile({userId}: {userId?: string}) {
324
325
To work around this limitation, you can add an explicit type annotation to the `redirect` function:
Copy file name to clipboardexpand all lines: packages/next-intl/CHANGELOG.md
+12
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,18 @@
3
3
All notable changes to this project will be documented in this file.
4
4
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
6
+
## 3.25.3 (2024-11-26)
7
+
8
+
### Bug Fixes
9
+
10
+
* Follow-up for [#1573](https://github.com/amannn/next-intl/issues/1573) to also handle the case when a non-default locale is in use ([#1578](https://github.com/amannn/next-intl/issues/1578)) ([fd71741](https://github.com/amannn/next-intl/commit/fd7174179881a19e3573fceb9c6e903923644761)), closes [#1568](https://github.com/amannn/next-intl/issues/1568) – by @amannn
11
+
12
+
## 3.25.2 (2024-11-25)
13
+
14
+
### Bug Fixes
15
+
16
+
* Handle inconsistency in Next.js when using `usePathname` with custom prefixes, `localePrefix: 'as-needed'` and static rendering ([#1573](https://github.com/amannn/next-intl/issues/1573)) ([20fd0f0](https://github.com/amannn/next-intl/commit/20fd0f0015839357893bcd256ff880a98b01ea1f)) – by @amannn
// @ts-expect-error -- Mirror the behavior from Next.js, where `null` is returned when `usePathname` is used outside of Next, but the types indicate that a string is always returned.
Copy file name to clipboardexpand all lines: packages/use-intl/CHANGELOG.md
+12
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,18 @@
3
3
All notable changes to this project will be documented in this file.
4
4
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
6
+
## 3.25.3 (2024-11-26)
7
+
8
+
### Bug Fixes
9
+
10
+
* Follow-up for [#1573](https://github.com/amannn/next-intl/issues/1573) to also handle the case when a non-default locale is in use ([#1578](https://github.com/amannn/next-intl/issues/1578)) ([fd71741](https://github.com/amannn/next-intl/commit/fd7174179881a19e3573fceb9c6e903923644761)), closes [#1568](https://github.com/amannn/next-intl/issues/1568) – by @amannn
11
+
12
+
## 3.25.2 (2024-11-25)
13
+
14
+
### Bug Fixes
15
+
16
+
* Handle inconsistency in Next.js when using `usePathname` with custom prefixes, `localePrefix: 'as-needed'` and static rendering ([#1573](https://github.com/amannn/next-intl/issues/1573)) ([20fd0f0](https://github.com/amannn/next-intl/commit/20fd0f0015839357893bcd256ff880a98b01ea1f)) – by @amannn
0 commit comments