Skip to content

Commit 957635d

Browse files
committed
use own interpolation function
1 parent 2771083 commit 957635d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### 2.6.2
1+
### 2.6.3
22

33
- use own interpolation function instead of relying on i18next's interpolator
44

lib/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defaults, debounce, getPath, setPath, pushPath } from './utils.js'
1+
import { defaults, debounce, getPath, setPath, pushPath, interpolate } from './utils.js'
22
import { readFile, readFileSync } from './readFile.js'
33
import { writeFile, removeFile } from './writeFile.js'
44

@@ -35,7 +35,7 @@ class Backend {
3535
if (typeof this.options.loadPath === 'function') {
3636
loadPath = this.options.loadPath(language, namespace)
3737
}
38-
const filename = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace })
38+
const filename = interpolate(loadPath, { lng: language, ns: namespace })
3939
if (this.allOptions.initAsync === false || this.allOptions.initImmediate === false) {
4040
try {
4141
const { data, stat } = readFileSync(filename, this.options)
@@ -98,7 +98,7 @@ class Backend {
9898
if (typeof this.options.addPath === 'function') {
9999
addPath = this.options.addPath(language, namespace)
100100
}
101-
const filename = this.services.interpolator.interpolate(addPath, { lng: language, ns: namespace })
101+
const filename = interpolate(addPath, { lng: language, ns: namespace })
102102
removeFile(filename, this.options)
103103
.then(() => {})
104104
.catch(() => {})
@@ -124,7 +124,7 @@ class Backend {
124124
addPath = this.options.addPath(lng, namespace)
125125
}
126126

127-
const filename = this.services.interpolator.interpolate(addPath, { lng, ns: namespace })
127+
const filename = interpolate(addPath, { lng, ns: namespace })
128128

129129
const missings = getPath(this.queuedWrites, [lng, namespace])
130130
setPath(this.queuedWrites, [lng, namespace], [])

0 commit comments

Comments
 (0)