diff --git a/gui/app/components/document/section-attachment.js b/gui/app/components/document/section-attachment.js index 87b548b3..53c3bc8e 100644 --- a/gui/app/components/document/section-attachment.js +++ b/gui/app/components/document/section-attachment.js @@ -18,17 +18,24 @@ import Component from '@ember/component'; export default Component.extend(Modals, Notifier, { appMeta: service(), session: service(), + i18n: service(), editMode: false, downloadQuery: '', uploadId: computed('page', function () { let page = this.get('page'); return `page-uploader-${page.id}`; }), - uploadLabel: 'Upload Attachments', + uploadLabel: '', + + init(...args) { + this._super(...args); + + this.uploadLabel = this.i18n.localize('upload_attachment'); + }, didReceiveAttrs() { this._super(...arguments); - + // For authenticated users we send server auth token. let qry = ''; if (this.get('session.hasSecureToken')) { @@ -36,12 +43,12 @@ export default Component.extend(Modals, Notifier, { } else if (this.get('session.authenticated')) { qry = '?token=' + this.get('session.authToken'); } - this.set('downloadQuery', qry); + this.set('downloadQuery', qry); }, didRender() { this._super(...arguments); - + // For authenticated users we send server auth token. let qry = ''; if (this.get('session.hasSecureToken')) { @@ -49,7 +56,7 @@ export default Component.extend(Modals, Notifier, { } else if (this.get('session.authenticated')) { qry = '?token=' + this.get('session.authToken'); } - this.set('downloadQuery', qry); + this.set('downloadQuery', qry); // We don't setup uploader if not edit mode. if (!this.get('editMode')) { @@ -95,7 +102,7 @@ export default Component.extend(Modals, Notifier, { }); this.on("queuecomplete", function () { - self.notifySuccess('Uploaded file'); + self.notifySuccess(this.i18n.localize('uploaded')); self.get('onAttachmentUpload')(); }); @@ -120,7 +127,7 @@ export default Component.extend(Modals, Notifier, { actions: { onDelete(attachment) { - this.notifySuccess('File deleted'); + this.notifySuccess(this.i18n.localize('deleted')); this.get('onAttachmentDelete')(attachment.id); } } diff --git a/gui/app/templates/components/document/document-toolbar.hbs b/gui/app/templates/components/document/document-toolbar.hbs index 36e433d0..edbc2cff 100644 --- a/gui/app/templates/components/document/document-toolbar.hbs +++ b/gui/app/templates/components/document/document-toolbar.hbs @@ -4,15 +4,15 @@ {{#ui/ui-toolbar-dropdown label="Actions" arrow=true}} {{#attach-popover class="ember-attacher-popper" hideOn="click clickout" showOn="click" isShown=false}}
{{/attach-popover}} {{/ui/ui-toolbar-dropdown}} @@ -23,26 +23,26 @@ {{#attach-popover class="ember-attacher-popper" hideOn="click clickout" showOn="click" isShown=false}} {{/attach-popover}} @@ -53,10 +53,10 @@ {{#attach-popover class="ember-attacher-popper" hideOn="click clickout" showOn="click" isShown=false}} {{/attach-popover}} @@ -64,25 +64,25 @@ {{/if}} {{#if permissions.documentEdit}} - {{ui/ui-toolbar-icon icon=constants.Icon.Settings color=constants.Color.Green tooltip="Rename, Categories, Tag, Status, Workflow" linkTo="document.settings"}} + {{ui/ui-toolbar-icon icon=constants.Icon.Settings color=constants.Color.Green tooltip=(localize 'settings') linkTo="document.settings"}} {{/if}} {{/ui/ui-toolbar}}