From 8a9e4504fea9edd693ceecf314308cd08e99f0ca Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Sat, 1 Aug 2020 10:29:09 +0200 Subject: [PATCH] DEV: allows to decouple csv-uploader texts from bulk invite (#10344) --- .../javascripts/discourse/app/components/csv-uploader.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/csv-uploader.js b/app/assets/javascripts/discourse/app/components/csv-uploader.js index 884e7724bd..abc8e061b1 100644 --- a/app/assets/javascripts/discourse/app/components/csv-uploader.js +++ b/app/assets/javascripts/discourse/app/components/csv-uploader.js @@ -8,6 +8,7 @@ export default Component.extend(UploadMixin, { type: "csv", tagName: "span", uploadUrl: "/invites/upload_csv", + i18nPrefix: "user.invited.bulk_invite", validateUploadedFilesOptions() { return { csvOnly: true }; @@ -15,9 +16,7 @@ export default Component.extend(UploadMixin, { @discourseComputed("uploading") uploadButtonText(uploading) { - return uploading - ? I18n.t("uploading") - : I18n.t("user.invited.bulk_invite.text"); + return uploading ? I18n.t("uploading") : I18n.t(`${this.i18nPrefix}.text`); }, @discourseComputed("uploading") @@ -27,7 +26,7 @@ export default Component.extend(UploadMixin, { }, uploadDone() { - bootbox.alert(I18n.t("user.invited.bulk_invite.success")); + bootbox.alert(I18n.t(`${this.i18nPrefix}.success`)); }, uploadOptions() { @@ -39,7 +38,7 @@ export default Component.extend(UploadMixin, { $upload.on("fileuploadadd", (e, data) => { bootbox.confirm( - I18n.t("user.invited.bulk_invite.confirmation_message"), + I18n.t(`${this.i18nPrefix}.confirmation_message`), I18n.t("cancel"), I18n.t("go_ahead"), result => (result ? data.submit() : data.abort())