Skip to content

Commit

Permalink
support initAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Nov 22, 2024
1 parent 236da23 commit d19284b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const i18next = require('i18next')
const Backend = require('../../cjs')

i18next.use(Backend).init({
// initAsync: false,
initAsync: false,
lng: 'en',
fallbackLng: 'en',
preload: ['en', 'de'],
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.initAsync === false) {
if (this.allOptions.initAsync === false || this.allOptions.initImmediate === false) {
try {
const { data, stat } = readFileSync(filename, this.options)
const timestamp = stat && stat.mtime && stat.mtime.getTime()
Expand Down

0 comments on commit d19284b

Please sign in to comment.