Object rest spread

This commit is contained in:
Renée Kooi 2018-10-08 12:46:29 +02:00
parent cd71bc48b3
commit 0f4f7dffff
No known key found for this signature in database
GPG key ID: 8CDD5F0BC448F040

View file

@ -39,9 +39,12 @@ module.exports = class AwsS3 extends Plugin {
locale: defaultLocale
}
this.opts = Object.assign({}, defaultOptions, opts)
this.locale = Object.assign({}, defaultLocale, this.opts.locale)
this.locale.strings = Object.assign({}, defaultLocale.strings, this.opts.locale.strings)
this.opts = { ...defaultOptions, ...opts }
this.locale = {
...defaultLocale,
...this.opts.locale,
strings: { ...defaultLocale.strings, ...this.opts.locale.strings }
}
this.translator = new Translator({ locale: this.locale })
this.i18n = this.translator.translate.bind(this.translator)