From 236da23567767732ac8f6d881c44acad10a998ab Mon Sep 17 00:00:00 2001 From: Adriano Raiano Date: Fri, 22 Nov 2024 14:37:24 +0100 Subject: [PATCH] update deps --- README.md | 4 ++-- example/deno/index.js | 4 ++-- example/fastify/app.js | 4 ++-- example/fastify/lambda.js | 2 +- example/fastify/lib/i18n.js | 2 +- example/fastify/package.json | 14 +++++++------- example/node/index.js | 4 ++-- example/node/package.json | 2 +- lib/index.js | 2 +- package.json | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index a858cec..15a184e 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ i18n }) ``` -# If set i18next initImmediate option to false it will load the files synchronously +# If set i18next initAsync option to false it will load the files synchronously ```js // i18n.js @@ -121,7 +121,7 @@ i18next .use(Backend) .init({ // debug: true, - initImmediate: false, + initAsync: false, fallbackLng: 'en', lng: 'en', preload: readdirSync(join(__dirname, '../locales')).filter((fileName) => { diff --git a/example/deno/index.js b/example/deno/index.js index d1f3820..9f23c2c 100644 --- a/example/deno/index.js +++ b/example/deno/index.js @@ -5,7 +5,7 @@ import Backend from 'https://deno.land/x/i18next_fs_backend/index.js' // import Backend from '../../lib/index.js' i18next.use(Backend).init({ - // initImmediate: false, + // initAsync: false, lng: 'en', fallbackLng: 'en', preload: ['en', 'de'], @@ -20,6 +20,6 @@ i18next.use(Backend).init({ console.log(t('welcome')) console.log(t('welcome', { lng: 'de' })) }) -// this will only work if initImmediate is set to false, because it's async +// this will only work if initAsync is set to false, because it's async console.log(i18next.t('welcome')) console.log(i18next.t('welcome', { lng: 'de' })) diff --git a/example/fastify/app.js b/example/fastify/app.js index 77096d9..049bc4f 100755 --- a/example/fastify/app.js +++ b/example/fastify/app.js @@ -1,5 +1,5 @@ import fastify from 'fastify' -import pov from 'point-of-view' +import pov from '@fastify/view' import pug from 'pug' import { register, i18next } from './lib/i18n.js' import mail from './lib/mail.js' @@ -32,7 +32,7 @@ app.get('/', (request, reply) => { if (import.meta.url === `file://${process.argv[1]}`) { // called directly - app.listen(port, (err) => { + app.listen({ port }, (err) => { if (err) return console.error(err) console.log(i18next.t('server.started', { port })) console.log(i18next.t('server.started', { port, lng: 'de' })) diff --git a/example/fastify/lambda.js b/example/fastify/lambda.js index 1048e7d..7468076 100644 --- a/example/fastify/lambda.js +++ b/example/fastify/lambda.js @@ -1,3 +1,3 @@ -import awsLambdaFastify from 'aws-lambda-fastify' +import awsLambdaFastify from '@fastify/aws-lambda' import app from './app.js' export const handler = awsLambdaFastify(app) diff --git a/example/fastify/lib/i18n.js b/example/fastify/lib/i18n.js index 0ef2c2a..7f84ce5 100644 --- a/example/fastify/lib/i18n.js +++ b/example/fastify/lib/i18n.js @@ -13,7 +13,7 @@ i18next .use(Backend) .init({ // debug: true, - initImmediate: false, // setting initImediate to false, will load the resources synchronously + initAsync: false, // setting initImediate to false, will load the resources synchronously fallbackLng: 'en', preload: readdirSync(localesFolder).filter((fileName) => { const joinedPath = join(localesFolder, fileName) diff --git a/example/fastify/package.json b/example/fastify/package.json index 86beb84..0181ebc 100644 --- a/example/fastify/package.json +++ b/example/fastify/package.json @@ -9,13 +9,13 @@ "deploy": "npm run cf_package && npm run cf_deploy" }, "dependencies": { - "aws-lambda-fastify": "1.7.0", - "fastify": "3.29.4", - "i18next": "20.3.2", - "i18next-fs-backend": "1.1.1", - "i18next-http-middleware": "3.1.4", - "mjml": "4.10.1", - "point-of-view": "4.15.0", + "@fastify/aws-lambda": "5.0.0", + "fastify": "5.1.0", + "i18next": "24.0.0", + "i18next-fs-backend": "2.5.0", + "i18next-http-middleware": "3.6.0", + "mjml": "4.15.3", + "@fastify/view": "10.0.1", "pug": "3.0.3" } } diff --git a/example/node/index.js b/example/node/index.js index 8d277c1..4f7b36d 100644 --- a/example/node/index.js +++ b/example/node/index.js @@ -2,7 +2,7 @@ const i18next = require('i18next') const Backend = require('../../cjs') i18next.use(Backend).init({ - // initImmediate: false, + // initAsync: false, lng: 'en', fallbackLng: 'en', preload: ['en', 'de'], @@ -17,6 +17,6 @@ i18next.use(Backend).init({ console.log(t('welcome')) console.log(t('welcome', { lng: 'de' })) }) -// this will only work if initImmediate is set to false, because it's async +// this will only work if initAsync is set to false, because it's async console.log(i18next.t('welcome')) console.log(i18next.t('welcome', { lng: 'de' })) diff --git a/example/node/package.json b/example/node/package.json index a8286e6..5f499d1 100644 --- a/example/node/package.json +++ b/example/node/package.json @@ -1,6 +1,6 @@ { "type": "commonjs", "dependencies": { - "i18next": "23.16.6" + "i18next": "24.0.0" } } diff --git a/lib/index.js b/lib/index.js index c001058..32b7069 100644 --- a/lib/index.js +++ b/lib/index.js @@ -36,7 +36,7 @@ class Backend { loadPath = this.options.loadPath(language, namespace) } const filename = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }) - if (this.allOptions.initImmediate === false) { + if (this.allOptions.initAsync === false) { try { const { data, stat } = readFileSync(filename, this.options) const timestamp = stat && stat.mtime && stat.mtime.getTime() diff --git a/package.json b/package.json index 32756c8..c2b99b1 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "eslint-plugin-require-path-exists": "1.1.9", "eslint-plugin-standard": "5.0.0", "expect.js": "0.3.1", - "i18next": "23.16.6", + "i18next": "24.0.0", "js-yaml": "4.1.0", "jsonc-parser": "3.3.1", "json5": "2.2.3",