Kaynağa Gözat

Fix `i18n` in aws-s3, thumbnail-generator, and xhr-upload (#3142)

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Jhen-Jie Hong 3 yıl önce
ebeveyn
işleme
7763cedd50

+ 4 - 1
packages/@uppy/aws-s3/src/index.js

@@ -124,6 +124,9 @@ module.exports = class AwsS3 extends BasePlugin {
 
     this.opts = { ...defaultOptions, ...opts }
 
+    // TODO: remove i18n once we can depend on XHRUpload instead of MiniXHRUpload
+    this.i18nInit()
+
     this.#client = new RequestClient(uppy, opts)
     this.#requests = new RateLimitedQueue(this.opts.limit)
   }
@@ -269,7 +272,7 @@ module.exports = class AwsS3 extends BasePlugin {
       getResponseError: defaultGetResponseError,
     }
 
-    // Only for MiniXHRUpload, remove once we can depend on XHRUpload directly again
+    // TODO: remove i18n once we can depend on XHRUpload instead of MiniXHRUpload
     xhrOptions.i18n = this.i18n
 
     // Revert to `uppy.use(XHRUpload)` once the big comment block at the top of

+ 1 - 0
packages/@uppy/thumbnail-generator/src/index.js

@@ -35,6 +35,7 @@ module.exports = class ThumbnailGenerator extends UIPlugin {
     }
 
     this.opts = { ...defaultOptions, ...opts }
+    this.i18nInit()
 
     if (this.opts.lazy && this.opts.waitForThumbnailsBeforeUpload) {
       throw new Error('ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.')

+ 1 - 0
packages/@uppy/xhr-upload/src/index.js

@@ -117,6 +117,7 @@ module.exports = class XHRUpload extends BasePlugin {
     }
 
     this.opts = { ...defaultOptions, ...opts }
+    this.i18nInit()
 
     this.handleUpload = this.handleUpload.bind(this)