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 f9ec6ac commit a04edd2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [v3.7.0](https://github.com/i18next/i18next-http-middleware/compare/v3.6.0...v3.7.0)
- support i18next v24

## [v3.6.0](https://github.com/i18next/i18next-http-middleware/compare/v3.5.0...v3.6.0)
- introduce convertDetectedLanguage option

Expand Down
2 changes: 1 addition & 1 deletion example/deno/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ i18next
.use(i18nextMiddleware.LanguageDetector)
.init({
// debug: true,
initImmediate: false, // setting initImediate to false, will load the resources synchronously
initAsync: false, // setting initAsync to false, will load the resources synchronously
backend: {
// eslint-disable-next-line no-path-concat
loadPath: 'locales/{{lng}}/{{ns}}.json',
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function handle (i18next, options = {}) {
}
}

const i18n = i18next.cloneInstance({ initImmediate: false })
const i18n = i18next.cloneInstance({ initAsync: false, initImmediate: false })
i18n.on('languageChanged', lng => {
// Keep language in sync
req.language = req.locale = req.lng = lng
Expand Down
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,29 @@
},
"module": "./esm/index.js",
"devDependencies": {
"@babel/cli": "7.23.0",
"@babel/core": "7.23.3",
"@babel/preset-env": "7.23.3",
"@hapi/hapi": "^21.3.2",
"@types/express-serve-static-core": "^4.17.41",
"@babel/cli": "7.25.9",
"@babel/core": "7.26.0",
"@babel/preset-env": "7.26.0",
"@hapi/hapi": "^21.3.12",
"@types/express-serve-static-core": "^5.0.1",
"@koa/router": "12.0.1",
"koa": "2.14.2",
"koa": "2.15.3",
"babel-plugin-add-module-exports": "1.0.4",
"eslint": "8.53.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-n": "16.3.1",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-n": "16.6.2",
"eslint-plugin-promise": "6.6.0",
"eslint-plugin-require-path-exists": "1.1.9",
"eslint-plugin-standard": "5.0.0",
"expect.js": "0.3.1",
"express": "4.20.0",
"fastify": "4.24.3",
"i18next": "23.7.1",
"mocha": "10.2.0",
"supertest": "6.3.3",
"tsd": "0.29.0",
"uglify-js": "3.17.4"
"express": "4.21.1",
"fastify": "5.1.0",
"i18next": "24.0.0",
"mocha": "10.8.2",
"supertest": "7.0.0",
"tsd": "0.31.2",
"uglify-js": "3.19.3"
},
"description": "i18next-http-middleware is a middleware to be used with Node.js web frameworks like express or Fastify and also for Deno.",
"keywords": [
Expand Down

0 comments on commit a04edd2

Please sign in to comment.