From 30aa8aadb6f923cef05201abf7ce2be714f935aa Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Mon, 1 Aug 2022 10:13:03 -0400 Subject: [PATCH] Fix i18n bug for PDF viewer --- gui/app/components/document/section-attachment.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/app/components/document/section-attachment.js b/gui/app/components/document/section-attachment.js index 53c3bc8e..24d4b0e9 100644 --- a/gui/app/components/document/section-attachment.js +++ b/gui/app/components/document/section-attachment.js @@ -81,6 +81,8 @@ export default Component.extend(Modals, Notifier, { let uploadId = this.get('uploadId'); // Handle upload clicks on button and anything inside that button. + let uploadSuccess = this.i18n.localize('uploaded'); + let sel = ['#' + uploadId, '#' + uploadId + ' > div']; for (var i=0; i < 2; i++) { let dzone = new Dropzone(sel[i], { @@ -101,8 +103,8 @@ export default Component.extend(Modals, Notifier, { this.on("success", function (/*file, response*/ ) { }); - this.on("queuecomplete", function () { - self.notifySuccess(this.i18n.localize('uploaded')); + this.on("queuecomplete", () => { + self.notifySuccess(uploadSuccess); self.get('onAttachmentUpload')(); });