Change Log
All notable changes to this project will be documented in this file.
See Conventional Commits for commit guidelines.
4.1.0 (2025-04-24)
Features
- Add
forcePrefix
option for redirect
and getPathname
(#1865) (5905976) – by @amannn
4.0.3 (2025-04-22)
Bug Fixes
- Support stable Turbopack config in Next.js 15.3 (#1850) (30ec8e0), closes #1838 – by @amannn
4.0.2 (2025-03-13)
Bug Fixes
4.0.1 (2025-03-12)
Bug Fixes
4.0.0 (2025-03-12)
See the announcement.
(#1412) (172656f) – by @amannn
3.26.5 (2025-02-21)
Bug Fixes
- Handle
query
in <Link />
correctly when using localePrefix: 'as-needed'
with domains
(#1732) (ec8776e), closes #1731 – by @amannn
3.26.4 (2025-02-18)
Bug Fixes
- Add workaround for OpenTelemetry/Zone.js (#1719) (1cac9a6), closes #1711 – by @amannn
3.26.3 (2024-12-20)
Bug Fixes
- Add missing deprecation warnings for
next-intl@4.0
(#1485) (1d60d08) – by @amannn
3.26.2 (2024-12-18)
Bug Fixes
3.26.1 (2024-12-11)
Bug Fixes
- Use new domain
next-intl.dev
in links (#1601) (40a9a77) – by @amannn
3.26.0 (2024-12-06)
Features
3.25.3 (2024-11-26)
Bug Fixes
- Follow-up for #1573 to also handle the case when a non-default locale is in use (#1578) (fd71741), closes #1568 – by @amannn
3.25.2 (2024-11-25)
Bug Fixes
- Handle inconsistency in Next.js when using
usePathname
with custom prefixes, localePrefix: 'as-needed'
and static rendering (#1573) (20fd0f0) – by @amannn
3.25.1 (2024-11-13)
Bug Fixes
- Correctly handle search params in redirects when using
trailingSlash: true
(#1537) (03a4620) – by @deini
3.25.0 (2024-11-08)
Features
- Add type exports to enable
declaration: true
in tsconfig.json
(#1509) (6b2ca9c) – by @osaton
3.24.0 (2024-10-31)
Features
3.23.5 (2024-10-24)
Bug Fixes
- Don't warn when setting
prefetch={true}
on <Link />
(#1463) (fd6d73d), closes #1462 – by @amannn
3.23.4 (2024-10-24)
Bug Fixes
3.23.3 (2024-10-24)
Bug Fixes
- Resolve locale for navigation APIs consistently from
i18n/request.ts
in react-server
like all other APIs do (#1459) (8c6d5ff) – by @amannn
3.23.2 (2024-10-22)
Bug Fixes
- Handle inlined search params and hashes correctly in
<Link />
from createNavigation
(#1448) (ba0a537) – by @amannn
3.23.1 (2024-10-22)
Bug Fixes
- Remove usage of deprecated
ReactNodeArray
which is removed in React 19 (#1445) (2396345) – by @amannn
3.23.0 (2024-10-22)
Features
- Add Next.js 15 to peer dependencies (#1443) (4cb22bb) – by @amannn
3.22.0 (2024-10-21)
Features
- feat:
createNavigation
(#1316)
- feat: Add async
requestLocale
param to getRequestConfig for Next.js 15 support (#1383)
- feat: Add
localeCookie
option for middleware (#1414)
- feat: Add
setRequestLocale
(#1437)
Fixes
- fix: When using
domains
, handle unknown domains more gracefully (#1389)
Deprecations
- Deprecate
defaultTranslationValues
(#1411)
- Deprecate
unstable_setRequestLocale
(#1437)
3.21.1 (2024-10-09)
Bug Fixes
- Repair package publishing workflow (this release doesn't include any library changes) (ceba9ae) – by @amannn
3.21.0 (2024-10-09)
Features
- Add
t.has
to check whether a given message exists (#1399) (ee1a2a9) – by @tholander
3.20.0 (2024-09-24)
Features
3.19.5 (2024-09-24)
Bug Fixes
- Make all keys of
Formats
type optional for easier usage (#1367) (a7cbd9b) – by @amannn
3.19.4 (2024-09-19)
Bug Fixes
- Handle malformed pathnames in middleware (#1353) (dcda9d9), closes #1351 – by @amannn
3.19.3 (2024-09-17)
Bug Fixes
- Handle overlapping locale prefixes correctly pt. 2 (#1344) (7958659) – by @amannn
3.19.2 (2024-09-17)
Bug Fixes
- Handle overlapping custom locale prefixes correctly (#1343) (72c1731), closes #1329 – by @amannn
3.19.1 (2024-09-05)
Bug Fixes
- Add error handling in case an invalid i18n request config file has been specified (#1327) (18b9fd6) – by @amannn
3.19.0 (2024-08-30)
Features
- Support
./i18n/request.ts
in addition to ./i18n.ts
(#1308) (258e95e) – by @amannn
3.18.1 (2024-08-29)
Bug Fixes
- Print warning for inconsistent i18n setup where no
locale
is read in getRequestConfig
and also none is returned (#1305) (2f0f781) – by @amannn
3.18.0 (2024-08-28)
Features
- Add
defineRouting
for easier i18n routing setup (#1299) (5ff6120) – by @amannn
3.17.6 (2024-08-23)
Bug Fixes
- Enable React Compiler ESLint plugin and fix relevant case (#1281) (606f4cc) – by @amannn
3.17.5 (2024-08-23)
Bug Fixes
- Lazy init message formatter for improved tree shaking in case
useTranslations
is only used in Server Components (#1279) (9f1725c) – by @amannn
3.17.4 (2024-08-20)
Bug Fixes
- Update
@formatjs/intl-localematcher
to latest version (#1140) (c217582) – by @amannn
3.17.3 (2024-08-14)
Bug Fixes
- Handle optional catch-all segments in navigation APIs if no value is provided and handle the case if a dynamic value appears multiple times in a pathname (#1259) (58ef482), closes #1236 – by @amannn
3.17.2 (2024-07-19)
Bug Fixes
- Fix open redirect vulnerability for
localePrefix: 'as-necessary'
by sanitizing pathname in the middleware (#1208) (f42ac01), closes #1207 – by @hblee12294
3.17.1 (2024-07-15)
Bug Fixes
- Apply
useMemo
for useRouter
returned from createLocalizedPathnamesNavigation
to keep a stable reference when possible (#1201) (a1b9a36), closes #1198 – by @amannn
3.17.0 (2024-07-12)
Features
3.16.0 (2024-07-11)
Features
- Support
trailingSlash: true
in Next.js config (#1190) (cfbdee9) – by @amannn
3.15.5 (2024-07-09)
Bug Fixes
3.15.4 (2024-07-08)
Bug Fixes
3.15.3 (2024-06-26)
Bug Fixes
- Prefer more specific routes in
usePathname
when detecting the currently active pathname for localized pathnames (#1152) (936839e), closes #1151 – by @amannn
3.15.2 (2024-06-19)
Note: Version bump only for package root
3.15.1 (2024-06-19)
Bug Fixes
- Remove
@formatjs/ecma402-abstract
dependency in favor of the automatically bundled one from intl-messageformat
(#1141) – by @amannn
3.15.0 (2024-06-10)
Features
- Add support for custom prefixes for i18n routing (#1086) (4ba921a)
3.14.1 (2024-05-23)
Bug Fixes
3.14.0 (2024-05-15)
Features
- Support providing a locale in
i18n.ts
instead of reading it from the pathname (#1017) (5c968b2)
3.13.0 (2024-05-08)
Features
- Support
numberingSystem
and style
for relative time formatting (#1057) (14e3aa4), closes #1056
3.12.2 (2024-05-03)
Bug Fixes
- Print a warning in case the middleware didn't run on a request but APIs from
next-intl
are used (#1045) (8149955)
3.12.1 (2024-05-02)
Bug Fixes
- Correctly parse date skeleton
EEEE
to a long weekday like "Tuesday" (upgrades to intl-messageformat@10
internally) (#1039) (d6b5fd2)
3.12.0 (2024-04-26)
Features
3.11.3 (2024-04-17)
Bug Fixes
- When using domain-based routing, use
defaultLocale
of a domain instead of the top-level one in case no other locale matches better on the domain (#1000) (42988b7), closes #998
3.11.2 (2024-04-17)
Bug Fixes
- Correctly detect base path at the app root
/
when using a locale prefix strategy other than always
. This ensures the locale cookie is set correctly. (#999) (1ce5988), closes #997
3.11.1 (2024-04-05)
Bug Fixes
- Apply correct port when redirecting to another domain and the app doesn't run behind a proxy (#979 by @awkaiser-tr) (485f59e), closes #658
3.11.0 (2024-04-03)
Features
3.10.0 (2024-03-25)
Features
- When using localized pathnames, allow access to internal pathnames only if they match an entry from a particular locale—otherwise redirect (#914 by @RomainGueffier) (0658600)
3.9.5 (2024-03-15)
Bug Fixes
- Improve support for older browsers by switching from
replaceAll
to replace
(#885 by @MichalMoravik) (080333a), closes #884
3.9.4 (2024-03-08)
Bug Fixes
- Handle changing href for
<Link />
correctly when using localePrefix: 'never'
(#926) (b609dc0), closes #918
3.9.3 (2024-03-07)
Bug Fixes
- Handle optional params in catch-all segments correctly when using localized pathnames (#925) (8ba8b69), closes #917
3.9.2 (2024-03-05)
Bug Fixes
3.9.1 (2024-02-23)
Bug Fixes
- Return
now
from global context if no updateInterval
has been set on useNow
(#881) (dbbefcf)
3.9.0 (2024-02-20)
Features
3.8.0 (2024-02-19)
Features
3.7.0 (2024-02-09)
Features
3.6.0 (2024-02-08)
Features
- Support formatting of React elements via
format.list(…)
. (#845) (7bf11d4)
3.5.4 (2024-02-01)
Bug Fixes
- Keep cookie value in sync when navigating within a locale (#828) (1167523), closes #826
3.5.3 (2024-01-29)
Bug Fixes
- Improve RSC render performance by sharing a cache between
getTranslations
and useTranslations
(#798 by @fkapsahili) (73e8337)
3.5.2 (2024-01-25)
Bug Fixes
3.5.1 (2024-01-23)
Bug Fixes
- Remove
x-default
alternate links entry for non-root pathnames when using localePrefix: 'always'
(#805) (c5bb0f5)
3.5.0 (2024-01-22)
Features
- Make options for
createSharedPathnamesNavigation
along with locales
argument optional (relevant when locales
aren't known statically) (#784) (614053d)
3.4.5 (2024-01-19)
Bug Fixes
- Make sure cookie value stays up to date when the Next.js Router Cache is used (#790) (977b973), closes #786 #786
3.4.4 (2024-01-17)
Bug Fixes
- Improve error message for missing messages by including the locale (#782) (79eee9d)
3.4.3 (2024-01-16)
Bug Fixes
- Apply global
timeZone
when using date skeletons in messages (e.g. Ordered on {orderDate, date, ::yyyyMd}
) (#695) (8940192), closes #693
3.4.2 (2024-01-09)
Bug Fixes
- Change
numeric
option from auto
to always
for format.relativeTime
(#765) (246d373), closes #757
3.4.1 (2024-01-03)
Bug Fixes
3.4.0 (2023-12-21)
Features
3.3.3 (2023-12-20)
Bug Fixes
- 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)
3.3.2 (2023-12-11)
Bug Fixes
- Fix types for passing a custom
type
to redirect
(#714) (db65cb7), closes #709
3.3.1 (2023-12-07)
Bug Fixes
- Improve error message when encountering a missing message in production (#706) (515891b)
3.3.0 (2023-12-06)
Features
3.2.5 (2023-12-06)
Bug Fixes
- Correctly normalize pathname for redirects and alternate links when
localePrefix: 'as-needed'
is used with the default locale (#698 by @anna-colenso) (48e9523)
3.2.4 (2023-12-05)
Bug Fixes
- Fix compatibility with
moduleResolution: 'Bundler'
(#694) (f7425a5), closes #690
3.2.3 (2023-12-05)
Bug Fixes
- Prefer
locale
from NextIntlClientProvider
when using useLocale
in Client Components. useParams().locale
is still used as a fallback. (#691) (e00ed97), closes #688
3.2.2 (2023-12-04)
Bug Fixes
- Allow to call
getRequestConfig
in outer module closure in a Client Component module graph (#687) (0f16f10), closes #685
3.2.1 (2023-12-01)
Bug Fixes
- 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
3.2.0 (2023-11-29)
Features
- Add
localePrefix
for navigation APIs for an improved initial render of Link
when using localePrefix: 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
3.1.4 (2023-11-24)
Bug Fixes
- Apply correct port and protocol during domain-based redirects when called from an internal address (e.g. from a proxy) (#662) (2bb867d), closes #658
3.1.3 (2023-11-22)
Bug Fixes
- Don't set cookie on response if
localeDetection: false
(#654) (e85149c), closes #609
3.1.2 (2023-11-20)
Bug Fixes
3.1.1 (2023-11-20)
Note: Version bump only for package root
3.1.0 (2023-11-17)
Features
- Experimental support for
--turbo
(requires next@^14.0.3
) (#641) (46c6ec7), closes #250
3.0.3 (2023-11-15)
Bug Fixes
- Don't retrieve defaults for
locale
, now
and timeZone
if these options have been provided to NextIntlClientProvider
(#633) (824363a), closes #631
3.0.2 (2023-11-15)
Bug Fixes
- Allow usage of
getTranslations({namespace})
without TypeScript integration for messages (#630) (62cf29c), closes #625
3.0.1 (2023-11-14)
Add provenance statement to published packages.
3.0.0 (2023-11-14)
Please refer to the release notes.
2.22.1 (2023-11-02)
Bug Fixes
2.22.0 (2023-11-02)
Features
2.21.0 (2023-10-18)
Features
- Support custom units in
format.relativeTime
(#566) (6e1bc35)
2.20.2 (2023-09-22)
Bug Fixes
- Add error reporting when no
timeZone
is specified and downgrade error handling for missing now
value from throwing to reporting an error (#519) (dc55ab2)
2.20.1 (2023-09-21)
Bug Fixes
- Use correct port for alternate links when running behind a proxy (#514 by @iza-w) (747ad5b)
2.20.0 (2023-08-23)
Features
- 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
2.19.4 (2023-08-23)
Bug Fixes
- Allow to import
next-intl/link
into Server Components without having to add a wrapping Client Component (#465) (21a0691)
2.19.3 (2023-08-23)
Bug Fixes
- Apply time zone for built-in default formats (
full
, long
, medium
, short
) (#473) (244b9b2), closes #467
2.19.2 (2023-08-22)
Bug Fixes
- Use correct host and protocol for alternate links when running behind a proxy (
x-forwarded-host
, x-forwarded-proto
) (#462 by @HHongSeungWoo) (747cf8e)
2.19.1 (2023-08-01)
Bug Fixes
- Handle case where the
locale
param is an array and set cookie expiration to one year (#435) (82e842c)
2.19.0 (2023-07-18)
Features
2.18.0 (2023-07-17)
Features
2.17.5 (2023-07-07)
Bug Fixes
- Use ESM build only for browser bundlers (not Node.js) (#386) (34a69f2)
2.17.4 (2023-07-05)
Bug Fixes
- Bring back ESM build (and fix bundle size) (#381) (4d0fefc)
2.17.3 (2023-07-05)
Bug Fixes
- Forward optional remaining args from Next.js router to wrapped
useRouter
(3ff878c)
2.17.2 (2023-07-05)
Bug Fixes
2.17.1 (2023-07-04)
Bug Fixes
- Switch to
tsup
for more efficient bundling and also switch to vitest
internally (#375) (bf31626)
2.17.0 (2023-06-29)
Features
- Add autocomplete support for
timeZone
(#359 by @A7med3bdulBaset) (630dfc2)
2.16.0 (2023-06-29)
Features
- Add
useMessages
for convenience and restructure docs to be App Router-first (#345) (0dedbfd)
2.15.1 (2023-06-21)
Bug Fixes
- Allow usage of
next-intl/link
and usePathname
outside of Next.js (#338) (6e1a56c), closes #337
2.15.0 (2023-06-20)
Features
2.14.6 (2023-05-22)
Note: Version bump only for package root
2.14.5 (2023-05-22)
Bug Fixes
- Set
SameSite
attribute for locale cookie to strict
(#302) (0a6bce5), closes #301
2.14.4 (2023-05-22)
Bug Fixes
2.14.3 (2023-05-22)
Bug Fixes
2.14.2 (2023-05-12)
Bug Fixes
- Fix forwarding of request headers in middleware (#269 by @ARochniak) (4ecbab5), closes #266
2.14.1 (2023-05-11)
Bug Fixes
- Fix support for older Next.js versions by moving
Link
to next-intl/link
(#288) (f26ef99), closes #287
2.14.0 (2023-05-10)
Features
- Add navigation APIs for App Router (
useRouter
, usePathname
and Link
) (#282) (e30a89b)
2.13.4 (2023-05-05)
Note: Version bump only for package root
2.13.3 (2023-05-05)
Note: Version bump only for package root
2.13.2 (2023-05-03)
Bug Fixes
- Improve warning for invalid namespace characters (7435335)
2.13.1 (2023-04-14)
Bug Fixes
- Improve error message when trying to render an array as a message (#244) (c6a4f7a)
2.13.0 (2023-04-12)
Features
2.12.0 (2023-03-25)
Features
2.11.0 (2023-03-06)
Features
2.10.4 (2023-02-20)
Bug Fixes
- Return up-to-date translations when messages change (#199) (78f39b4)
2.10.3 (2023-02-19)
Note: Version bump only for package root
2.10.2 (2022-12-09)
Bug Fixes
2.10.1 (2022-12-09)
Note: Version bump only for package root
2.10.0 (2022-12-09)
Features
2.9.2 (2022-12-08)
Note: Version bump only for package root
2.9.1 (2022-11-03)
Note: Version bump only for package root
2.9.0 (2022-10-27)
Features
2.8.0 (2022-10-18)
Features
- Provide
createTranslator
and createIntl
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)
2.7.6 (2022-09-22)
Note: Version bump only for package root
2.7.5 (2022-08-30)
Note: Version bump only for package root
2.7.4 (2022-05-30)
Bug Fixes
- Adapt TypeScript validation to work with messages files that only have a single top-level namespace (#115) (cf0b83e)
2.7.3 (2022-05-20)
Bug Fixes
- Add back the ability to render the provider without messages (#113) (8395822)
2.7.2 (2022-05-10)
Bug Fixes
2.7.1 (2022-04-28)
Bug Fixes
2.7.0 (2022-04-28)
Features
2.6.0 (2022-04-08)
Features
2.5.0 (2022-04-01)
Features
2.4.1 (2022-03-24)
Bug Fixes
2.4.0 (2022-02-08)
Features
2.3.5 (2022-01-19)
Bug Fixes
- Support identical wrappers with identical text content in rich text (#80) (b35bb9f)
2.3.4 (2022-01-04)
Bug Fixes
- Allow usage outside of Next.js (e.g. Jest and Storybook) (#76) (7c6925b)
2.3.3 (2021-12-23)
Note: Version bump only for package root
2.3.2 (2021-12-23)
Note: Version bump only for package root
2.3.1 (2021-12-23)
Note: Version bump only for package root
2.3.0 (2021-11-24)
Features
2.2.1 (2021-11-23)
Bug Fixes
- Clearer error message when no messages are provided (#66) (742729a)
2.2.0 (2021-11-02)
Features
- TypeScript improvements: Use enum type for
style
of NumberFormatOptions
, only allow passing React children to messages rendered with t.rich
and update tslib
(#63) (d73e935)
2.1.1 (2021-10-28)
Note: Version bump only for package root
2.1.0 (2021-10-27)
Features
2.0.5 (2021-09-28)
Note: Version bump only for package root
2.0.4 (2021-09-28)
Note: Version bump only for package root
2.0.3 (2021-09-17)
Note: Version bump only for package root
2.0.2 (2021-09-17)
Bug Fixes
- Render correct messages when the namespace changes in
useTranslations
(#58) (b8f7dab)
2.0.1 (2021-09-04)
Note: Version bump only for package root
2.0.0 (2021-08-26)
- feat!: Use a separate API for rich text formatting to avoid type casting in TypeScript #54 (4c13a64), closes #54
BREAKING CHANGES
- 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 use t.rich
instead now.
1.5.1 (2021-08-13)
Bug Fixes
- Improve API for rendering raw messages and add docs (#51) (19f4a7e)
1.5.0 (2021-08-10)
Features
1.4.7 (2021-08-02)
Bug Fixes
- Adjust default for
onError
of the provider to log errors correctly (#46) (d0a1986)
1.4.6 (2021-08-02)
Bug Fixes
- Use
timeZone
in translation function from useTranslations
(#45) (ebf75f2)
1.4.5 (2021-07-26)
Note: Version bump only for package root
1.4.4 (2021-07-08)
Note: Version bump only for package root
1.4.3 (2021-07-08)
Note: Version bump only for package root
1.4.2 (2021-06-16)
Bug Fixes
- Don't require
react-dom
as a peer dependency (#39) (39edfcd)
1.4.1 (2021-06-16)
Bug Fixes
- Use correct version range for use-intl (02c33d3)
1.4.0 (2021-06-16)
Features
1.3.11 (2021-05-07)
Note: Version bump only for package root
1.3.10 (2021-05-02)
Note: Version bump only for package root
1.3.9 (2021-05-02)
Note: Version bump only for package root
1.3.8 (2021-03-26)
Note: Version bump only for package root
1.3.7 (2021-02-12)
Note: Version bump only for package root
1.3.6 (2021-02-09)
Note: Version bump only for package root
1.3.5 (2021-02-09)
Note: Version bump only for package root
1.3.4 (2021-02-09)
Note: Version bump only for package root
1.3.3 (2021-02-09)
Bug Fixes
1.3.2
- Fix: Limit the function signature to return strings or React elements
1.3.1
- Fix: Apply interval correctly in
useNow({updateInterval: …})
1.3.0
- Feat: Add a global fallback for the
now
parameter of formatRelativeTime
.
- Feat: Add
useNow
hook, which can be used in conjunction with formatRelativeTime
to continuously update the result.
- Fix: Allow
messages
to be optional on the provider.
1.2.0
- Feat: Added specific types for
DateTimeFormatOptions
.
1.1.0
- Feat: Added support for handling time zones.
1.0.1
- Fix: Use 1.0 version of
use-intl
.
1.0.0
This library is now considered production ready. There are no changes from the previous version.
0.4.0
- Feature: Add global formats (see docs)
0.3.2
- Fix: Export
IntlErrorCode
for JavaScript users.
0.3.1
- Fix: Return a stable function reference for
t
.
0.3.0
- Feature: Add error handling capabilities (see docs)
0.2.0
- Chore: Depend on
use-intl
- BREAKING CHANGE: Rename
NextIntlMessages
to IntlMessages
(TypeScript only)
0.1.1
- Fix: Don't throw for empty messages (
""
).