Skip to content

Commit bbb5b08

Browse files
committed
docs: Update blog post
1 parent 1a9dd14 commit bbb5b08

File tree

5 files changed

+33
-20
lines changed

5 files changed

+33
-20
lines changed

docs/src/pages/blog/_meta.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export default {
33
title: 'Overview'
44
},
55
'next-intl-4-0': {
6-
title: 'next-intl 4.0 beta',
6+
title: 'next-intl 4.0',
77
display: 'hidden'
88
},
99
'next-intl-3-22': {

docs/src/pages/blog/index.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import StayUpdated from '@/components/StayUpdated.mdx';
66
<div className="flex flex-col gap-4 py-8">
77
<BlogPostLink
88
href="/blog/next-intl-4-0"
9-
title="next-intl 4.0 beta"
10-
date="Dec 23, 2024"
9+
title="next-intl 4.0"
10+
date="Mar 12, 2025"
1111
author="By Jan Amann"
1212
/>
1313
<BlogPostLink

docs/src/pages/blog/next-intl-4-0.mdx

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: next-intl 4.0 beta
2+
title: next-intl 4.0
33
---
44

55
import PartnerContentLink from '@/components/PartnerContentLink';
66
import StayUpdated from '@/components/StayUpdated.mdx';
77

8-
# next-intl 4.0 beta
8+
# next-intl 4.0
99

10-
<small>Dec 23, 2024 · by Jan Amann</small>
10+
<small>Mar 12, 2025 · by Jan Amann</small>
1111

1212
After a year of feature development, this release focuses on streamlining the API surface while maintaining the core architecture of `next-intl`. With many improvements already released in [previous minor versions](/blog/next-intl-3-22), this update introduces several enhancements that will improve your development experience and make working with internationalization even more seamless.
1313

@@ -44,7 +44,7 @@ declare module 'next-intl' {
4444
}
4545
```
4646

47-
See the updated [TypeScript augmentation](https://v4.next-intl.dev/docs/workflows/typescript) guide.
47+
See the updated [TypeScript augmentation](/docs/workflows/typescript) guide.
4848

4949
## Strictly-typed locale
5050

@@ -65,7 +65,7 @@ declare module 'next-intl' {
6565

6666
By doing so, APIs like `useLocale()` or `<Link />` that either return or receive a `locale` will now pick up your app-specific `Locale` type, improving type safety across your app.
6767

68-
To simplify narrowing of `string`-based locales, a `hasLocale` function has been added. This can for example be used in [`i18n/request.ts`](https://v4.next-intl.dev/docs/getting-started/app-router/with-i18n-routing#i18n-request) to return a valid locale:
68+
To simplify narrowing of `string`-based locales, a `hasLocale` function has been added. This can for example be used in [`i18n/request.ts`](/docs/getting-started/app-router/with-i18n-routing#i18n-request) to return a valid locale:
6969

7070
```tsx
7171
import {getRequestConfig} from 'next-intl/server';
@@ -148,13 +148,13 @@ t('followers', {count: 30000});
148148
"{count, number} followers"
149149
```
150150

151-
Due to a current limitation in TypeScript, this feature is opt-in for now. Please refer to the [strict arguments](https://v4.next-intl.dev/docs/workflows/typescript#messages-arguments) docs to learn how to enable it.
151+
Due to a current limitation in TypeScript, this feature is opt-in for now. Please refer to the [strict arguments](/docs/workflows/typescript#messages-arguments) docs to learn how to enable it.
152152

153153
## GDPR compliance [#gdpr-compliance]
154154

155155
In order to comply with the current GDPR regulations, the following changes have been made and are relevant to you if you're using the `next-intl` middleware for i18n routing:
156156

157-
1. The locale cookie now defaults to a session cookie that expires when a browser is closed.
157+
1. The locale cookie now defaults to a session cookie that expires when the browser is closed.
158158
2. The locale cookie is now only set when a user switches to a locale that doesn't match the `accept-language` header.
159159

160160
If you want to increase the cookie expiration, e.g. because you're informing users about the usage of cookies or if GDPR doesn't apply to your app, you can use the `maxAge` attribute to do so:
@@ -174,11 +174,11 @@ export const routing = defineRouting({
174174
});
175175
```
176176

177-
Since the cookie is now only available after a locale switch, make sure to not rely on it always being present. E.g. if you need access to the user's locale in a [Route Handler](https://v4.next-intl.dev/docs/environments/actions-metadata-route-handlers#route-handlers), a reliable option is to provide the locale as a search param (e.g. `/api/posts/12?locale=en`).
177+
Since the cookie is now only available after a locale switch, make sure to not rely on it always being present. E.g. if you need access to the user's locale in a [Route Handler](/docs/environments/actions-metadata-route-handlers#route-handlers), a reliable option is to provide the locale as a search param (e.g. `/api/posts/12?locale=en`).
178178

179-
As part of this change, disabling a cookie now requires you to set [`localeCookie: false`](https://v4.next-intl.dev/docs/routing#locale-cookie) in your routing configuration. Previously, `localeDetection: false` ambiguously also disabled the cookie from being set, but since a separate `localeCookie` option was introduced recently, this should now be used instead.
179+
As part of this change, disabling a cookie now requires you to set [`localeCookie: false`](/docs/routing#locale-cookie) in your routing configuration. Previously, `localeDetection: false` ambiguously also disabled the cookie from being set, but since a separate `localeCookie` option was introduced recently, this should now be used instead.
180180

181-
Learn more in the [locale cookie](https://v4.next-intl.dev/docs/routing#locale-cookie) docs.
181+
Learn more in the [locale cookie](/docs/routing#locale-cookie) docs.
182182

183183
## Modernized build output
184184

@@ -266,7 +266,7 @@ This will create the following structure:
266266
- `example.no`: `no-NO`
267267
- `example.no/en`: `en-NO`
268268

269-
Learn more in the updated docs for [`domains`](https://v4.next-intl.dev/docs/routing#domains).
269+
Learn more in the updated docs for [`domains`](/docs/routing#domains).
270270

271271
## Preparation for upcoming Next.js features [#nextjs-future]
272272

@@ -300,11 +300,9 @@ For a smooth upgrade, please initially upgrade to the latest v3.x version and ch
300300
Afterwards, you can upgrade by running:
301301

302302
```
303-
npm install next-intl@v4-beta
303+
npm install next-intl@4
304304
```
305305

306-
The beta docs are available here: [v4.next-intl.dev](https://v4.next-intl.dev)
307-
308306
I'd love to hear about your experiences with `next-intl@4.0`! Join the conversation in the [discussions](https://github.com/amannn/next-intl/discussions/1631).
309307

310308
## Thank you!
@@ -315,6 +313,8 @@ A special thank you goes to <PartnerContentLink href="https://crowdin.com/">Crow
315313

316314
—Jan
317315

316+
(this post has been updated from an initial announcement for the 3.0 release candidate)
317+
318318
PS: Have you heard that [learn.next-intl.dev](https://learn.next-intl.dev) is coming?
319319

320320
<StayUpdated />

docs/src/pages/index.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ import GetStartedBackground from '@/components/GetStartedBackground';
2020
description="Support multiple languages, with your app code becoming simpler instead of more complex."
2121
getStarted="Get started"
2222
viewExample="View an example"
23+
announcement={{
24+
href: '/blog/next-intl-4-0',
25+
label: 'next-intl 4.0 is out now!'
26+
}}
2327
/>
2428
<PartnerBanner intro="Presented by" />
2529

docs/src/theme.config.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,21 @@ export default {
2727
pre: Pre
2828
},
2929
banner: {
30+
key: 'banner-learn-next-intl',
3031
content: (
3132
<div className="text-center">
32-
You‘re viewing the next-intl 4 beta docs
33+
Announcing{' '}
34+
<a
35+
className="underline"
36+
href="https://learn.next-intl.dev"
37+
rel="noreferrer"
38+
target="_blank"
39+
>
40+
learn.next-intl.dev
41+
</a>
42+
!
3343
</div>
34-
),
35-
dismissible: false
44+
)
3645
},
3746
footer: {
3847
component: Footer

0 commit comments

Comments
 (0)