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: .github/ISSUE_TEMPLATE/02_feature_request.yml
+10-2
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,18 @@ labels:
6
6
body:
7
7
- type: markdown
8
8
attributes:
9
-
value: Thanks for taking the time to file a feature request! Please fill out this form completely.
9
+
value: Thanks for taking the time to improve next-intl!
10
10
- type: markdown
11
11
attributes:
12
-
value: Please keep in mind that if something doesn't work as expected, you might want to [create a bug report](https://github.com/amannn/next-intl/issues/new/choose) instead. Bug reports disguised as feature requests will be closed.
12
+
value: |
13
+
Please keep in mind:
14
+
15
+
- If you're looking for specific support with your project, you can consider [asking for community support](https://github.com/amannn/next-intl/issues/new/choose) instead.
16
+
- If something doesn't work as expected, you might want to [create a bug report](https://github.com/amannn/next-intl/issues/new/choose) instead.
17
+
- Please double check the [docs](https://next-intl.dev) to see if your feature request is already supported.
18
+
- Please also check the [existing issues](https://github.com/amannn/next-intl/issues) to see if your feature request was already discussed.
19
+
20
+
If you have a feature request that has not been discussed yet, please fill out this form completely.
13
21
- type: textarea
14
22
attributes:
15
23
label: Is your feature request related to a problem? Please describe.
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.26.5 (2025-02-21)
7
+
8
+
### Bug Fixes
9
+
10
+
* Handle `query` in `<Link />` correctly when using `localePrefix: 'as-needed'` with `domains` ([#1732](https://github.com/amannn/next-intl/issues/1732)) ([ec8776e](https://github.com/amannn/next-intl/commit/ec8776e8f0344f78fea4f71284c48312484a7059)), closes [#1731](https://github.com/amannn/next-intl/issues/1731) – by @amannn
11
+
12
+
## 3.26.4 (2025-02-18)
13
+
14
+
### Bug Fixes
15
+
16
+
* Add workaround for OpenTelemetry/Zone.js ([#1719](https://github.com/amannn/next-intl/issues/1719)) ([1cac9a6](https://github.com/amannn/next-intl/commit/1cac9a65d2aefe20ff7fcf734e70f1fe85cac19d)), closes [#1711](https://github.com/amannn/next-intl/issues/1711) – by @amannn
6.[**Preparation for upcoming Next.js features**](#nextjs-future)
21
+
6.[**Improved inheritance in `NextIntlClientProvider`**](#nextintlclientprovider-inheritance)
22
+
7.[**Stricter config for `domains`**](#domains-config)
23
+
8.[**Preparation for upcoming Next.js features**](#nextjs-future)
22
24
23
25
Please also have a look at the [other breaking changes](#other-breaking-changes) listed below before you upgrade.
24
26
@@ -188,6 +190,82 @@ The build output of `next-intl` has been modernized and now leverages the follow
188
190
189
191
With these changes, the bundle size of `next-intl` has been reduced by ~7% ([all details](https://github.com/amannn/next-intl/pull/1470)).
190
192
193
+
## Improved inheritance of `NextIntlClientProvider`[#nextintlclientprovider-inheritance]
194
+
195
+
Previously, [`NextIntlClientProvider`](/docs/usage/configuration#nextintlclientprovider) would conservatively inherit only a subset from `i18n/request.ts`.
196
+
197
+
To improve the getting started experience, the provider now also inherits:
Due to this, you can now remove these props from `NextIntlClientProvider` if you've previously passed them manually:
203
+
204
+
```diff
205
+
<NextIntlClientProvider
206
+
- messages={messages}
207
+
- formats={formats}
208
+
>
209
+
{/* ... */}
210
+
</NextIntlClientProvider>
211
+
```
212
+
213
+
With this, `NextIntlClientProvider` now inherits all of your configuration, with the minor exception of [error handling functions](/docs/usage/configuration#error-handling). Since functions are not serializable, they cannot be passed across the server/client boundary. However, [an alternative](https://github.com/amannn/next-intl/issues/1285) for this is also on the horizon.
214
+
215
+
To make it easier to work with error handling functions on the client side, `NextIntlClientProvider` can now also be used in a nested fashion and will inherit the configuration from a parent provider ([PR #1413](https://github.com/amannn/next-intl/pull/1413)).
216
+
217
+
## Stricter config for `domains`[#domains-config]
218
+
219
+
So far, when using [`domains`](/docs/routing#domains) in combination with [`localePrefix: 'as-needed'`](/docs/routing#locale-prefix-as-needed), `next-intl` had to make some [tradeoffs](https://next-intl-docs-6wwcmwb9a-next-intl.vercel.app/docs/routing#domains-localeprefix-asneeded) to avoid reading the current host of the incoming request in components.
220
+
221
+
Now, by introducing two new constraints, `next-intl` can avoid these tradeoffs altogether:
222
+
223
+
1. A locale can now only be used for a single domain
224
+
2. Each domain now must specify its `locales`
225
+
226
+
The result is a simplified, more intuitive model that works as expected for this popular use case.
227
+
228
+
If you previously used locales across multiple domains, you now have to be more specific—typically by introducing a regional variant for a base language. You can additionally customize the prefixes if desired.
229
+
230
+
**Example:**
231
+
232
+
```tsx
233
+
import {defineRouting} from'next-intl/routing';
234
+
235
+
exportconst routing =defineRouting({
236
+
locales: ['sv-SE', 'en-SE', 'no-NO', 'en-NO'],
237
+
defaultLocale: 'en-SE',
238
+
localePrefix: {
239
+
mode: 'as-needed',
240
+
prefixes: {
241
+
'en-SE': '/en',
242
+
'en-NO': '/en'
243
+
}
244
+
},
245
+
domains: [
246
+
{
247
+
domain: 'example.se',
248
+
defaultLocale: 'sv-SE',
249
+
locales: ['sv-SE', 'en-SE']
250
+
},
251
+
{
252
+
domain: 'example.no',
253
+
defaultLocale: 'no-NO',
254
+
locales: ['no-NO', 'en-NO']
255
+
}
256
+
]
257
+
});
258
+
```
259
+
260
+
This will create the following structure:
261
+
262
+
-`example.se`: `sv-SE`
263
+
-`example.se/en`: `en-SE`
264
+
-`example.no`: `no-NO`
265
+
-`example.no/en`: `en-NO`
266
+
267
+
Learn more in the updated docs for [`domains`](https://v4.next-intl.dev/docs/routing#domains).
268
+
191
269
## Preparation for upcoming Next.js features [#nextjs-future]
192
270
193
271
To ensure that the sails of `next-intl` are set for a steady course in the upcoming future, I've investigated the implications of upcoming Next.js features like [`ppr`](https://nextjs.org/docs/app/api-reference/next-config-js/ppr), [`dynamicIO`](https://nextjs.org/docs/canary/app/api-reference/config/next-config-js/dynamicIO) and [`rootParams`](https://github.com/vercel/next.js/pull/72837) for `next-intl`.
@@ -196,7 +274,7 @@ This led to three minor changes:
196
274
197
275
1. If you don't already have a `NextIntlClientProvider` in your app that wraps all Client Components that use `next-intl`, you now have to add one (see [PR #1541](https://github.com/amannn/next-intl/pull/1541) for details).
198
276
2. If you're using `format.relativeTime` in Client Components, you may need to provide the `now` argument explicitly now (see [PR #1536](https://github.com/amannn/next-intl/pull/1536) for details).
199
-
3. If you're using i18n routing, make sure you've updated to [`await requestLocale`](https://next-intl.dev/blog/next-intl-3-22#await-request-locale) that was introduced in `next-intl@3.22`. The previously deprecated `locale` argument will serve an edge case in the future once `rootParams` is a thing (see [PR #1625](https://github.com/amannn/next-intl/pull/1625/) for details).
277
+
3. If you're using i18n routing, make sure you've updated to [`await requestLocale`](/blog/next-intl-3-22#await-request-locale) that was introduced in `next-intl@3.22`. The previously deprecated `locale` argument will serve an edge case in the future once `rootParams` is a thing (see [PR #1625](https://github.com/amannn/next-intl/pull/1625/) for details).
200
278
201
279
While the mentioned Next.js features are still under development and may change, these changes seem reasonable to me in any case—and ideally will be all that's necessary to adapt for `next-intl` to get the most out of these upcoming capabilities.
202
280
@@ -205,13 +283,12 @@ I'm particularly excited about the announcement of `rootParams`, as it seems lik
205
283
## Other breaking changes
206
284
207
285
1. Return type-safe messages from `useMessages` and `getMessages` (see [PR #1489](https://github.com/amannn/next-intl/pull/1489))
208
-
2. Inherit context in case nested `NextIntlClientProvider` instances are present (see [PR #1413](https://github.com/amannn/next-intl/pull/1413))
209
-
3. Automatically inherit formats when `NextIntlClientProvider` is rendered from a Server Component (see [PR #1191](https://github.com/amannn/next-intl/pull/1191))
210
-
4. Require locale to be returned from `getRequestConfig` (see [PR #1486](https://github.com/amannn/next-intl/pull/1486))
211
-
5. Disallow passing `null`, `undefined` or `boolean` as an ICU argument (see [PR #1561](https://github.com/amannn/next-intl/pull/1561))
212
-
6. Bump minimum required TypeScript version to 5 for projects using TypeScript (see [PR #1481](https://github.com/amannn/next-intl/pull/1481))
213
-
7. Remove deprecated APIs (see [PR #1479](https://github.com/amannn/next-intl/pull/1479))
214
-
8. Remove deprecated APIs pt. 2 (see [PR #1482](https://github.com/amannn/next-intl/pull/1482))
286
+
2. Require locale to be returned from `getRequestConfig` (see [PR #1486](https://github.com/amannn/next-intl/pull/1486))
287
+
3. Disallow passing `null`, `undefined` or `boolean` as an ICU argument (see [PR #1561](https://github.com/amannn/next-intl/pull/1561))
288
+
4. Bump minimum required TypeScript version to 5 for projects using TypeScript (see [PR #1481](https://github.com/amannn/next-intl/pull/1481))
289
+
5. Return `x-default` alternate link also for sub pages when using `localePrefix: 'always'` and update middleware matcher suggestion in docs (see [PR #1720](https://github.com/amannn/next-intl/pull/1720))
290
+
6. Remove deprecated APIs (see [PR #1479](https://github.com/amannn/next-intl/pull/1479))
291
+
7. Remove deprecated APIs pt. 2 (see [PR #1482](https://github.com/amannn/next-intl/pull/1482))
@@ -175,7 +171,7 @@ If you're using a sitemap to inform search engines about all pages of your site,
175
171
176
172
Note that by default, `next-intl` returns [the `link` response header](/docs/routing#alternate-links) to instruct search engines that a page is available in multiple languages. While this sufficiently links localized pages for search engines, you may choose to provide this information in a sitemap in case you have more specific requirements.
177
173
178
-
Next.js supports providing alternate URLs per language via the [`alternates` entry](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap#generate-a-localized-sitemap) as of version 14.2. You can use your default locale for the main URL and provide alternate URLs based on all locales that your app supports. Keep in mind that also the default locale should be included in the `alternates` object.
174
+
Next.js supports providing alternate URLs per language via the [`alternates` entry](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap#generate-a-localized-sitemap). You can construct a list of entries for each pathname and locale as follows:
0 commit comments