All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.
- Add redirects for case mismatches in locale prefixes (e.g.
/EN
→/en
) (#861 by @fkapsahili) (3b2b446)
- Add
format.dateTimeRange
(#769 by @martinmunillas) (9f12521)
- Add support for
permanentRedirect
in navigation APIs (#850 by @polvallverdu) (6508ddc)
- Improve RSC render performance by sharing a cache between
getTranslations
anduseTranslations
(#798 by @fkapsahili) (73e8337)
- Remove
x-default
alternate links entry for non-root pathnames when usinglocalePrefix: 'always'
(#805) (c5bb0f5)
- Make options for
createSharedPathnamesNavigation
along withlocales
argument optional (relevant whenlocales
aren't known statically) (#784) (614053d)
- Make sure cookie value stays up to date when the Next.js Router Cache is used (#790) (977b973), closes #786 #786
- Apply global
timeZone
when using date skeletons in messages (e.g.Ordered on {orderDate, date, ::yyyyMd}
) (#695) (8940192), closes #693
- Invoke
notFound()
when no locale was attached to the request and update docs to suggest validating the locale ini18n.ts
(#742) (e6d9878), closes #736 #716 /next-intl-docs.vercel.app/docs/usage/configuration#i18
- Improve performance when calling hooks like
useTranslations
in Server Components by making sure we only suspend when i18n config is initially loaded and never for subsequent calls (#741) (4185a72)
- Correctly normalize pathname for redirects and alternate links when
localePrefix: 'as-needed'
is used with the default locale (#698 by @anna-colenso) (48e9523)
- Prefer
locale
fromNextIntlClientProvider
when usinguseLocale
in Client Components.useParams().locale
is still used as a fallback. (#691) (e00ed97), closes #688
- Allow to call
getRequestConfig
in outer module closure in a Client Component module graph (#687) (0f16f10), closes #685
- Allow to import
next-intl/server
into Client Components (however not call any functions). This allows for easier testing of page components with multiple exports. (#683) (5ca4075), closes #681
- Add
localePrefix
for navigation APIs for an improved initial render ofLink
when usinglocalePrefix: never
. Also fix edge case in middleware when using localized pathnames for redirects that remove a locale prefix (fixes an infinite loop). (#678) (1c68e3b), closes #444
- Apply correct port and protocol during domain-based redirects when called from an internal address (e.g. from a proxy) (#662) (2bb867d), closes #658
- Update link to migration example in error messages (#648 by @outloudvi) (1f3b226)
Note: Version bump only for package root
- Don't retrieve defaults for
locale
,now
andtimeZone
if these options have been provided toNextIntlClientProvider
(#633) (824363a), closes #631
- Allow usage of
getTranslations({namespace})
without TypeScript integration for messages (#630) (62cf29c), closes #625
Add provenance statement to published packages.
Please refer to the release notes.
- Correct version range (ffbff8e)
- Add error reporting when no
timeZone
is specified and downgrade error handling for missingnow
value from throwing to reporting an error (#519) (dc55ab2)
- Improve runtime performance of
useTranslations
by avoiding the creation of message format instances if possible and introducing a cross-component message format cache (#475) (4d177f8), closes #294
- Allow to import
next-intl/link
into Server Components without having to add a wrapping Client Component (#465) (21a0691)
- Apply time zone for built-in default formats (
full
,long
,medium
,short
) (#473) (244b9b2), closes #467
- Use correct host and protocol for alternate links when running behind a proxy (
x-forwarded-host
,x-forwarded-proto
) (#462 by @HHongSeungWoo) (747cf8e)
- Handle case where the
locale
param is an array and set cookie expiration to one year (#435) (82e842c)
- Add
localePrefix: 'never'
option for middleware (#388 by @boris-arkenaar) (92ec33a), closes #366
- Forward optional remaining args from Next.js router to wrapped
useRouter
(3ff878c)
- Add
format.list(…)
for formatting conjunctions and disjunctions (#327 by @stefanprobst) (32cda32)
Note: Version bump only for package root
2.14.4 (2023-05-22)
- Move JSDoc for
next/link
(b85b6f5)
- Fix support for older Next.js versions by moving
Link
tonext-intl/link
(#288) (f26ef99), closes #287
Note: Version bump only for package root
Note: Version bump only for package root
- Improve warning for invalid namespace characters (7435335)
- Add
BigInt
support foruseFormatter.format()
by @tacomanator (#222) (a5ded6c)
Note: Version bump only for package root
Note: Version bump only for package root
- Add support for using
next-intl
in theapp
folder with Next.js 13 (see https://next-intl-docs.vercel.app/docs/next-13, #144) (18c94d6)
Note: Version bump only for package root
Note: Version bump only for package root
- Provide
createTranslator
andcreateIntl
by extracting a React-agnostic core library. Thanks to David Brands from Marvia for sponsoring the work on this feature, participating in discussion and providing feedback! (#137) (91f7489)
Note: Version bump only for package root
Note: Version bump only for package root
- Adapt TypeScript validation to work with messages files that only have a single top-level namespace (#115) (cf0b83e)
- Overwrite prerelease (6caf5c4)
2.4.0 (2022-02-08)
Note: Version bump only for package root
Note: Version bump only for package root
Note: Version bump only for package root
- TypeScript improvements: Use enum type for
style
ofNumberFormatOptions
, only allow passing React children to messages rendered witht.rich
and updatetslib
(#63) (d73e935)
Note: Version bump only for package root
Note: Version bump only for package root
Note: Version bump only for package root
Note: Version bump only for package root
Note: Version bump only for package root
- feat!: Use a separate API for rich text formatting to avoid type casting in TypeScript #54 (4c13a64), closes #54
- Instead of using the
t
function for formatting both regular messages and rich text, this function will only work for regular messages now. For rich text you can uset.rich
instead now.
Note: Version bump only for package root
Note: Version bump only for package root
Note: Version bump only for package root
1.4.2 (2021-06-16)
1.4.1 (2021-06-16)
- Use correct version range for use-intl (02c33d3)
1.4.0 (2021-06-16)
Note: Version bump only for package root
Note: Version bump only for package root
Note: Version bump only for package root
Note: Version bump only for package root
Note: Version bump only for package root
Note: Version bump only for package root
Note: Version bump only for package root
Note: Version bump only for package root
1.3.3 (2021-02-09)
- Fix: Limit the function signature to return strings or React elements
- Fix: Apply interval correctly in
useNow({updateInterval: …})
- Feat: Add a global fallback for the
now
parameter offormatRelativeTime
. - Feat: Add
useNow
hook, which can be used in conjunction withformatRelativeTime
to continuously update the result. - Fix: Allow
messages
to be optional on the provider.
- Feat: Added specific types for
DateTimeFormatOptions
.
- Feat: Added support for handling time zones.
- Fix: Use 1.0 version of
use-intl
.
This library is now considered production ready. There are no changes from the previous version.
- Feature: Add global formats (see docs)
- Fix: Export
IntlErrorCode
for JavaScript users.
- Fix: Return a stable function reference for
t
.
- Feature: Add error handling capabilities (see docs)
- Chore: Depend on
use-intl
- BREAKING CHANGE: Rename
NextIntlMessages
toIntlMessages
(TypeScript only)
- Fix: Don't throw for empty messages (
""
).