@uppy/core: fix i18n binding

This commit is contained in:
Antoine du Hamel 2021-07-30 15:48:58 +02:00
parent bb1c615dc4
commit 4ab06907c3

View file

@ -54,8 +54,6 @@ class Uppy {
#emitter = ee()
#translator
#preProcessors = new Set()
#uploaders = new Set()
@ -283,16 +281,10 @@ class Uppy {
}
i18nInit () {
this.#translator = new Translator([this.defaultLocale, this.opts.locale])
this.locale = this.#translator.locale
}
i18n (...args) {
return this.#translator.translate(...args)
}
i18nArray (...args) {
return this.#translator.translateArray(...args)
const translator = new Translator([this.defaultLocale, this.opts.locale])
this.i18n = translator.translate.bind(translator)
this.i18nArray = translator.translateArray.bind(translator)
this.locale = translator.locale
}
setOptions (newOpts) {