Compare Versions - next-i18next
npm / next-i18next / Compare Versions
- support i18next v24
- add possibility to pass resources directly via config and set localePath to null
- optimize/fix last change for turbo
- requires i18next >= v23.0.1
- requires react-i18next >= v13.0.0
- using a custom backend on server side should also lazy load the passed namespaces
- revert #2084
- another code snippet for #2084 to try to fix for dynamic pages
- different code snippet for #2084 to try to fix for dynamic pages
- log config path if no config found
- Error if custom localeStructure provided, but no ns option defined.
The v13.0.0 release is a major version to improve stability and general experience. It comes with 2 easy changes related to installation. Existing code shouldn't be impacted. Details can be found in the UPGRADING.md document.
Breaking changes
-
react-i18next and i18next have been moved to peer-dependencies. They must be installed in your app (#1966)
# Add react-i18next > 12.0.0 and i18next > 22.0.4 to your app dependencies npm install react-i18next i18next --save # NPM yarn add react-i18next i18next # Yarn pnpm add react-i18next i18next --save # PNPMThis might solve issues with duplicates and multiple i18n context instances. If you encounter any issue, please read the Troubleshoot doc before posting an issue.
-
Types augmentations are now handled by i18next instead of react-i18next (#1997). See the upgrade document here.
New
- Support for NextJs 13 (excluding new experimental layout / rsc)
- Upgrade to i18next v22 and react-i18next v12, see #1966
- Support for node 18 lts #2017
Fix
- Fix types for appWithTranslation #1987
New minimum versions
We've dropped support for nextjs < 12.0.0 / react < 17.0.2 (#1983) and node < 14 (#1974).
- fix: appWithTranslation re-renders _app when the locale is changed (#1954)
- feat: introduce onPreInitI18next option (#1960)
- fix: fallbackLng if namespaces are undefined (#1943 closes #1941)
Why a major version? The following changes could lead to more languages being loaded, which could increase the page size.
- feat: improve fallback language handling (#1927)
- feat: add support for nonExplicitSupportedLngs (#1930)
- feat: introduce extraLocales (#1916)
- fix: pass namespaces to the client also for custom backends (#1913)
- fix: pass namespaces to the client (#1912 closes #1839)
- feat: support nested namespace structure (#1911)
- fix: remove postinstall script
- first release with new project ownership
- update most dependencies
- update docs and example
- feat: support default locale by ignoring it (#1679)
Features:
- Allow client side translation loading (8132efd)
Documentation:
- Link to
react-i18nextconfig options (422a0f3)
Chores:
- Upgrade react-i18next (ae25f93)
Bug fixes:
- Respect
configOverride.resources(8d13429)
Chores:
- Mute vercel bot (8999125)
Features:
- Allow function type for
localePath(4ed12ec)
Documentation:
- Clarify config for custom interpolation suffix/prefix (5fff8de)
Bug fixes:
appWithTranslationuseMemobug (null locale) 584f534
Features:
- Expose
Translationcomponent fromreact-i18next
Chores:
- Added note for Vercel/Netlify using
serverSideTranslations(6b5841b)
Bug fixes:
- Set
interpolation.escapeValuetofalse(c9056a5)
Breaking changes:
- Remove interpolation from defaultConfig (bf1f608)
Documentation:
- Note for asynchronous backends (d761e76)
Chores:
- Bump i18next to v21.5.3 (a103cb8)
Refactor:
- Set config.react.useSuspense to
false(93d4f88)
Bug fixes:
- Pin
i18next-fs-backendto >=1.1.4
Breaking changes:
- Remove support for Node v10 (1bf723f)
- Bump i18next to v21 (21a30fe)
Features:
- Make
appWithTranslationgeneric overAppPropstype (76b8994)
Refactor:
- Remove
router.localecheck (d2d1b73)
Bug fixes:
- Move @types/i18next-fs-backend to dev deps (a7939f2)
Documentation:
- Update README with
addResourceBundleinfo (d8ad005)
Documentation:
- Improve README.md (52b157d)
Refactor:
- Move hook out of condition (e7eb577)
- Better support for shallow route changes (1f98177)
Features:
- Add
reloadOnPrerenderoption to reload resources (2c08b29)
Documentation:
- Fix typo in migration doc (a1339b5)
Chores:
- Removed compatibility with
getInitialPropsinfo in migration guide (3679e7f)
Bug fixes:
- Respect user-defined prefix/suffix when looking for default NS (315531a)
Bug fixes:
- Set client side backend options only if there is no custom backend (5ed1e91)
Bug fixes:
- Only import default config if no userConfig is passed (28cd9c6)
Bug fixes:
- Fixed issue where empty requiredNamespaces array returns all namespaces instead of no namespaces (a09a69b)
Bug fixes:
- fix: serverSideTranslations loading all locales (29147f5)
Bug fixes:
- Export Resources and DefaultNamespace from typings (fb5cbce)
- Client config ns assignment logic (336ed9c)
Documentation:
- Add v8 migration documentation (e76d9b0)
Documentation:
- docs: Update README.md (59b85a0)
Bug fixes:
- Fix 1181: Missing namespaces if they are not in the defaultLanguage (7474c93)
Bug fixes:
- fix: i18n.getFixedT to return correct t function (78d5d2e)
Chores:
- build: install @babel/runtime to satisfy dependency of @babel/plugin-transform-runtime (deeec29)
Documentation:
- docs: Update README with interpolation format example (78e1adf)
Bug fixes:
- Fix CVE-2021-23346 vulnerability (9f0a291)
Documentation:
- Update README Dockerfile (d57164d)
Bug fixes:
- Resolve memory leak, by cloning always from the main instance (2911d35)
Chores:
- Upgrade jest (8973022)
Refactor:
- Some tweaks to the example demo (c6fc2e3)
Bug fixes:
- strip public prefix correctly on the client (ff9b5fa)
- create i18next clone to fix #1063 (15c65ae)
Bug fixes:
- fix: generate types using tsc and stop shipping the /src directory (770170c)
- fix: prevent loading translations on each request (e7c5fad)
Features:
- Add globalI18n (7fd4f09)
Refactor:
- refactor: Add NextJsAppProps type (301ccf5)
Refactor:
- refactor: Add @types/i18next-fs-backend as dependency (86e5768)
Refactor:
- refactor: Enable TypeScript strict mode (365921d)
Documentation:
- docs: Update sponsors section (d9688f3)
Bug fixes:
- fix: Ship src dir to support TypeScript types (bd5d159)
Chores:
- chore(deps): bump ini from 1.3.5 to 1.3.7 (3f4f777)
- chore(deps): bump ini from 1.3.5 to 1.3.8 in /examples/simple (2943061)
Bug fixes:
- fix: Restore getAllNamespaces functionality (cfbd7aa)
Major rewrite of package, leveraging the built-in internationalised routing provided by NextJs.
For new projects, or migrating existing projects, please refer to the new documentation.
Chores:
- Bump
blfrom 1.2.2 to 1.2.3 (d441f9e)
Breaking changes:
- If using a custom backend,
fschecks and fallback tostaticdir will no longer be performed
Chores:
- Bump Next to v9.5.4 (210f6d2)
Bug fixes:
- Handles "cimode" correctly (a538ad4)
- Handling of backend options if using with other backends (25c4ce9)
Chores:
- Bump tree-kill from 1.2.1 to 1.2.2 (c37d2da)
- Bump lodash from 4.17.11 to 4.17.20 (5a6e0fb)
- Bump puppeteer from 1.11.0 to 1.13.0 (2c1f182)
Documentation:
- Added FAQ about how to use multiple files (5ebe924)
- Add required Next.js version to README (9a4ca30)
- Add a TypeScript usage section to the README (b3fb7a2)
Bug fixes:
I18nContextexported as type (b38b8a2)
Chores:
- Bump
ellipticfrom 6.5.2 to 6.5.3 (d042d64)
Documentation:
- Update
next exportnote (875558c)
Breaking Changes:
- Upgrade
i18nextdependencies (205d11e) - Set
cookieSameSiteto strict by default (ecb70d6) - Remove dependency on
detect-node(54f8195) - Swap middleware execution to expose
req.i18nagain during SSR (01069e3)
Features:
- Add
I18nContextexport (cf2858a)
Breaking Changes:
- The
localePathconfig option is now required, and must be an absolute path (recommendation is to usepath.resolve) - The
localeSubpathfunctionality is now supported via NextJsrewrites - Custom servers and use of middlewares are now actively discouraged
Features:
- Allow
config.otherLanguagesto be empty (e96aadb)
Dependencies:
- Move
@types/expressto dependencies (41f93d6)
Docs:
- Modified the example app and the instructions as per issue (037543f)
- Remove david-dm shield (dd5e793)
Bug Fixes:
- Fix
i18nextCJS issues (9eb6add, bdd48e3) - Fix
i18next-http-middlewarecookie bug (ff9239b)
Chores:
- Upgrade
i18nextdependencies (1c2cd29) - Update lockfiles (fc91d9a)
Chores:
- Bump
https-proxy-agentfrom 2.2.1 to 2.2.4 (56d75d0) - Update
i18nextdependencies (a721b2e)
Refactor:
- Switch to
i18next-http-middleware(65ec703)
Chores:
- Bump acorn from 5.7.3 to 5.7.4 (f84c786)
- Upgrade i18next-express-middleware (294ab6f)
Documentation:
- Specify the need for
getInitialPropsin stateless_app(881a3cc)
Features:
- Make
shallowRenderconfigurable (f8a555e)
Features:
- Add
initPromiseto NextI18Next class (8fcf555)
Features:
- Add /api/ to
ignoreRoutes(7b359b2)
Chores:
- Upgrade i18next to v19 (fcee908)
Bug Fixes:
- Check if pathname is string in subpath-is-present (a1c5aff)
Features:
- Public dir support (99f82cd)
Bug Fixes:
- Dedupe languages (e48f7e9)
- TypeScript declaration conflict error (154b379)
Chores:
- Bump mixin-deep from 1.3.1 to 1.3.2 (669f5e8)
- Bump eslint-utils from 1.3.1 to 1.4.3 (4aa7b6a)
- Bump handlebars from 4.1.0 to 4.5.3 (c3bd634)
Bug Fixes:
- Do not ignore routes at
i18nextMiddlewarelevel (d0b874a) - Set
stackTraceLimitproperly increateConsoleLog(a0dae6a) - Remove
forwardedRefprop from NextLink (4c749f8)
Documentation:
- Add item about changes to
package.json(234435f) - Remove IE11 warning (a457f11)
Chores:
- Remove the
<Container>component from custom<App>(1c1de39) - Update i18next dependencies (67db368)
Bug Fixes:
- Prevent removing
subPathwhen not required (ca7d241) - Update lng query param when
changeLanguageis called in middleware (5748fb0)
Tests:
- Refactor middleware tests (95b6e90)
Testing:
- Target multiple NodeJs versions in CircleCI builds (8cae67e)
Chores:
- Add tsconfig to npmignore (a04f7e0)
Bug Fixes:
- Modify middleware approach to fix 404s (4565e7f)
Documentation:
- Remove trailing slash from docs (d189349)
Bug Fixes:
- Don't call
nexton redirect in middleware (6ce951b)
Documentation:
- Update accessing current language section (6682b15)
Bug Fixes:
- Export
WithTranslationprops type for TypeScript (85fe39d)
Refactor:
- Use
initImmediatein SSR (db543b9)
Chores:
- Add yarn.lock to npmignore (680a55b)
Features:
- Custom
localeSubpathsvalues (09be96f)
Documentation:
- Update
localeSubpathsinfo (cfbda74)
Bug Fixes:
- Memory leak regression (cefb0f7)
- Add trailing slash to
ignoreRoutes(a13e6f4)
Refactor:
- Use
windowinstead ofprocess.browserinisServer
Bug Fixes:
- Only call
router.replacewhen lang has changed (0e27ac7) - Update of
i18nextandreact-i18nextversions (cb60360)
Chores:
- Upgrade lockfile (f567272)
Refactor:
- Refine clean script (internal) (d2b9adf)
Bug Fixes:
- Fix TypeScript exported typings (322b90e)
Tests:
- Cover default export type (e499b99)
Refactor:
- Migrate to TypeScript (8803371)
Bug Fixes:
- Use
asPathfor dynamic client side routing (0b314a6)
Documentation:
- Remove broken Greenkeeper badge (a1b2322)
Features:
- Export
withTranslationas an independent function (e3b3ee6)
Bug fixes:
- Do not call router events in SSR (a2a2075)
Refactor:
- Use
router.replaceafter every lang change (d7623f6) - Use
core-jsv2 to decrease bundle size (311c38b)
Docs:
- Add strictMode to config options table (c3f6157)
Refactor:
- Add useBuiltIns and bundlesize (4e7ff04)
Docs:
- Add BrowserStack attribution (aa9a400)
Bug fixes:
- Update Babel deps and use core-js (af3ae61)
- Root path redirect for localeSubpaths (aeb8959)
- Update CircleCI steps (f38ff69)
Features:
- Add package version to demo (a70539d)
- Delay language change until after loading namespaces (073bf5d)
- Add Procfile for Heroku deployment (b2c0b60)
Chores:
- Update npmignore (422a0a7)
Docs:
- Add demo to README (d362a50)
Testing:
- Validate exported types (5644ae5)
Refactor:
- Convert simple example to functional components and add styling (9295d04)
Chores:
- Upgrade NextJs to v9 (96da934)
Features:
- Re-export types from i18next (1ee689a)
Bug Fixes:
- Upgrade
react-i18nextto v10.11.3 to fix fsisClonebug (040cd0b)
Chores:
- Update husky to the latest version (2412e2a)
Features:
- Validate
defaultNSexists via fs (71bc3df) - Re-export type
WithTranslationfromreact-i18next(8c32ad0)
Features:
- Types for
react-i18nextv10 (af1ac04)
Chores:
- Update
i18nextto the latest version (e6a96b7)
Bug Fixes:
- Link no longer passed
props.lngwithreact-i18nextv10 (89cce34)
Refactor:
- Add
react-i18nextv10 withNamespaces warning (459224b)
Features:
- Update types.d.ts with
useTranslation(ed81b2f)
Refactor:
- Update
i18nextto the latest version (7ed1cd6) - Update
i18next-xhr-backendto the latest version (22b02aa) - Remove rm -rf from build scripts (0dd354b)
Docs:
- Update to reflect absence of
props.lng(1313f81)
Features:
- Add
useTranslation(a3477cf)
Refactor:
- Upgrade
react-i18nextto v10 (4657514)
Bug fixes:
- Do not call
next()after redirect (029324c)
Docs:
- Add note to README about serverless (4f8cf80)
Docs:
- Create
CONTRIBUTING.md(c02dadf)
Refactor:
- Added the TypeScript declaration file for middleware (bc96d30)
Feature:
- Load main language when initial language is locale specific (217aad1)
Docs:
- Add readme note to inform about polyfill solution for browsers (c49dd88)
- Add section on accessing current language (a78dcc5)
Refactor:
- Add localeExtension config option and clean up config procedure (bdea075)
Features:
- Support complex
fallbackLnglogic fromi18next(6f69e7c)
Refactor:
- Remove pretty-error (3bf77ee)
- Move setting of
config.backendto default configuration (56363e4)
Fix:
- Add linking to simple example (903d54c)
Docs:
- Update docs to clarify existing i18next paradigms (2a46e53)
- Add note to README about
next/head(eefe004)
Refactor:
- Rename
withConfigtowithInternals(b650001)
Features:
- Add support for full URLs in
LinkwithlocaleSubpaths(2aa2204)
Bug fixes:
- Remove T from return types (53525e0)
- Add config to NextI18Next declaration (84fb565)
Bug fixes:
- Add
strictModeto types (399947c)
Bug fixes:
- Remove extends of
withNamespaces(eb4a932)
Features:
- Add return type for
withNamespacesfunction (d85e18c)
Bug fixes:
- Return Component type in
appWithTranslation(8ebcc46)
Features:
- Improve TS types (b93814b)
Fix:
- Add
React.ElementTypetoappWithTranslationparameter type (9ab6c7c)
Chore:
- Add README to simple example (d8a6e51)
- Change NextI18Next import in example (9fdbefb)
Refactor:
- Transpile CJS to NextJs default target (2de3dee)
Fix:
- Protect against
req.i18nbeingundefinedinlng-from-req(5818432)
Fix:
- Throw an error for breaking change on
localeSubpaths
Refactor:
- Change locale subpaths to a string enum (a444400)
Breaking change: localeSubpaths is now a string, not a boolean.
Features:
- Add typescript types (f3b3a31)
Refactor:
- lngPathCorrector (8bf6fb4)
- Remove custom-routing example and move approach into docs (a4a16f6)
Chore:
- Pin react-i18next to v9.0.10 (aef9d97)
Fixes:
- i18n.on event listener memory leak (d1a15d0)
Features:
- Deep merge nested config options (47b4039)
Features:
- Export Router for imperative routing (8f121aa)
Chores:
- Update dev dependencies (89a0937)
Chore:
- Update i18next deps
Refactor:
- Babel setup (1fdb502)
Note: we are no longer using the add-module-exports plugin for ES module exports at dist/es/index.js, so if you using CJS you'll need to add a .default, as in: require('next-i18next').default. Otherwise you can specifically consume dist/commonjs/index.js.
Fix:
- Fallback language for non-supported language headers (eb40afd)
Chore:
- Create MIT License
Changes:
- Use
lngPathCorrectorwithinLinkcomponent - Cease all polyfilling via Babel
Update .npmignore.
Removed runtime polyfill and restructured dependencies.
Add peer dependencies to package.json.
Fix concurrency issues due to i18n singleton - fixes #135.
Add named exports to docs.
Add named exports to docs.
Revert v0.23.4.
Added module field for ES6 support.
Improved documentation, added issue templates.
Bug Fixes:
- Set
fallbackLngproperly in non-English cases - Throw
otherLanguageserror prior tocreateI18NextClient - Use
prepublishOnlyinstead ofprepare
Bug Fixes:
- Add core-js as an explicit dependency
Breaking changes:
Refactored next-i18next-middleware to behave more like common express
middleware, via #90.
Use of next-i18next/middleware has changed completely, and is reflected in the docs.
This refactor allows for support of custom routes, improved query string support, and more.
Bug Fixes:
- Query string now preserved during language change on
localeSubpaths = true
DX:
- Add error message if
wrappedComponentProps.pagePropsis undefined
Features:
- Add
customDetectorssupport - Refactor
appWithTranslationto work with custom routes
Fixed incorrect peer deps, and added a console error if config.otherLanguages is empty.
Chores:
- Updated deps
- Add GreenKeeper
Refactoring:
- Create
withConfigHOC for internal use
Bug fixes:
- Fix double call of
getInitialProps - Use
url.formatfor Linkasformatting
Bug fixes:
- Add
@babel/polyfillfor IE 11 support - Fallback to
Component.name, etc, for warning messages - Fix
serverLanguageDetectiondisable logic
Lots of bug fixes, including:
- Removal of
withNamespacesprops fromLinkcomponent - Use 302 redirects instead of 301 and prevent caching for
localeSubpaths
New features:
- Add
serverLanguageDetectionconfig option - Add error page to example
Pass all props through Link component.
Revert 34e8e08 due to zeit/next.js#6026.
Two small bug fixes for dev experience.
Important functionality updates relating to fallback languages and browser detection. Added the lng-from-req util and test coverage. Added e2e test coverage of the example project.
Persist language subpath across requests (especially to root) with localeSubpaths enabled.
Added a new ignoreRoutes config option to allow greater control over language cookies. See #68 for more information.
Important bug fix: add asset regex to forceTrailingSlash middleware.
Remove contributors badge.
Ignore jest files.
Several bug fixes. Updated url parsing approach. Added test infrastructure and tests for most units/components.
Update i18next deps
Always send defaultNS down to client
Add initObject with other object keys to getInitialProps
Export Trans component bound to i18n instance.
Bug fix for config.ns in appWithTranslation HOC, and add console warning when namespacesRequired is undefined.
Update docs.
Remove tree-walking approach in favour of explicitly-declared namespaces. See #54 for discussion.
Will fallback to sending all namespaces down to client. New namespacesRequired setting added to main README.
Several small bug fixes:
- Preserve querystring (2c3cb59)
- Fix empty
react-tree-walkercontext (22ec3cb)
Fix development-only tree walking bug related to 2386bf2.
This bug has something to do with react-i18next context, but is yet undiagnosed.
Several bug fixes, including:
- Allowing 'as' prop in Link and fixing 'href' prop (#45)
- Use
url.parseto support query parms with localeSubpaths (cb10d37)
Implement tree-walking to determine namespace deps based on individual requests.
See #40.
Several important updates to improve the distinction between client and server source.
Use of i18next-browser-languagedetector is now optional via the config option browserLanguageDetection.
Breaking change: the middleware must now be imported from next-i18next/middleware, and is not returned via class initialisation. This is to prevent it being included in the client bundle.
Add support for i18next plugins via a use array on the config object.
Run getInitialProps on wrapped _app, and improve documentation.
Add hoistNonReactStatics
Reduce Node version requirement to >=8 to support deployment via now.
Add support for next export, and add bug fix for pageProps.
Move eslint-plugin-react to devDependencies.
Add description and keywords for npm.
Add npm deployment, CI via CircleCI, and update docs.
Initial release - contains all core functionality necessary to localise a NextJs app.