Skip to content

Commit

Permalink
support i18next v24
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Nov 22, 2024
1 parent 33a67eb commit 7e81e16
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 35 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 15.4.0

- support i18next v24

## 15.3.1

- update some i18next dependencies to address [#2288](https://github.com/i18next/next-i18next/issues/2288)
Expand Down
6 changes: 3 additions & 3 deletions examples/auto-static-optimize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"interface": "i18next-resources-for-ts interface -i ./public/locales/en -o ./@types/resources.d.ts"
},
"dependencies": {
"i18next": "23.12.2",
"i18next": "24.0.0",
"i18next-chained-backend": "^4.6.2",
"i18next-http-backend": "^2.5.2",
"i18next-http-backend": "^3.0.1",
"i18next-localstorage-backend": "^4.2.0",
"next": "^14.2.1",
"next-i18next": "^15.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^15.0.0"
"react-i18next": "^15.1.1"
},
"devDependencies": {
"@types/node": "^20.12.7",
Expand Down
4 changes: 2 additions & 2 deletions examples/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"interface": "i18next-resources-for-ts interface -i ./public/locales/en -o ./@types/resources.d.ts"
},
"dependencies": {
"i18next": "23.14.0",
"i18next": "24.0.0",
"next": "^14.2.7",
"next-i18next": "^15.3.1",
"react": "^18.3.1",
"react-i18next": "^15.0.1",
"react-i18next": "^15.1.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/ssg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"clean": "rimraf .next out"
},
"dependencies": {
"i18next": "23.12.2",
"i18next": "24.0.0",
"next": "14.2.4",
"next-i18next": "^15.3.1",
"next-language-detector": "^1.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-i18next": "^15.0.0"
"react-i18next": "^15.1.1"
},
"devDependencies": {
"eslint-config-next": "14.2.4",
Expand Down
57 changes: 34 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@
"eslint-plugin-typescript-sort-keys": "^3.1.0",
"gh-release": "7.0.2",
"husky": "^8.0.3",
"i18next": "^23.12.2",
"i18next": "^24.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"next": "^14.0.1",
"npm-run-all": "^4.1.5",
"prettier": "3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^15.0.0",
"react-i18next": "^15.1.1",
"rimraf": "^5.0.5",
"size-limit": "^10.0.2",
"start-server-and-test": "^2.0.1",
Expand All @@ -136,7 +136,7 @@
"@types/hoist-non-react-statics": "^3.3.4",
"core-js": "^3",
"hoist-non-react-statics": "^3.3.2",
"i18next-fs-backend": "^2.3.2"
"i18next-fs-backend": "^2.6.0"
},
"peerDependencies": {
"i18next": ">= 23.7.13",
Expand Down
5 changes: 4 additions & 1 deletion src/config/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export const defaultConfig = {
defaultLocale: DEFAULT_LOCALE,
locales: LOCALES,
},
get initImmediate(): boolean {
get initImmediate(): boolean { // i18next < 24
return typeof window !== 'undefined'
},
get initAsync(): boolean {
return typeof window !== 'undefined'

Check warning on line 19 in src/config/defaultConfig.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Expected object keys to be in ascending order. 'initAsync' should be before 'initImmediate'

Check warning on line 19 in src/config/defaultConfig.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Expected object keys to be in ascending order. 'initAsync' should be before 'initImmediate'
},
interpolation: {
Expand Down
5 changes: 4 additions & 1 deletion src/createClient/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export default (config: InternalConfig): CreateClientReturn => {
...config,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
initImmediate: false,
initAsync: false,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
initImmediate: false, // i18next < 24
}) as I18n
}
let initPromise: InitPromise
Expand Down

0 comments on commit 7e81e16

Please sign in to comment.