diff --git a/gui/app/components/section/papertrail/type-editor.js b/gui/app/components/section/papertrail/type-editor.js index d37cbdcc..61c6dc3d 100644 --- a/gui/app/components/section/papertrail/type-editor.js +++ b/gui/app/components/section/papertrail/type-editor.js @@ -28,6 +28,7 @@ export default Component.extend(SectionMixin, NotifierMixin, { }, didReceiveAttrs() { + this._super(); let config = {}; try { diff --git a/gui/app/components/section/pdf/type-editor.js b/gui/app/components/section/pdf/type-editor.js index a89ae1cf..4293e099 100644 --- a/gui/app/components/section/pdf/type-editor.js +++ b/gui/app/components/section/pdf/type-editor.js @@ -28,6 +28,8 @@ export default Component.extend({ }, didReceiveAttrs() { + this._super(); + let pdfOption = {}; try { @@ -46,10 +48,10 @@ export default Component.extend({ this.set('pdfOption', pdfOption); this.setPDF(); }, - + didUpdateAttrs() { this._super(...arguments); - this.setPDF(); + this.setPDF(); }, setPDF() { @@ -60,7 +62,7 @@ export default Component.extend({ if (!_.isArray(files)) return; for (let i=0; i < files.length; i++) { - if (_.endsWith(files[i].get('extension'), 'pdf') && + if (_.endsWith(files[i].get('extension'), 'pdf') && files[i].get('pageId') === this.get('page.id')) { this.set('pdfName', files[i].get('filename')); this.set('pdfOption.fileId', files[i].get('id')); diff --git a/gui/app/components/section/plantuml/type-editor.js b/gui/app/components/section/plantuml/type-editor.js index 71964f40..295c3ed1 100644 --- a/gui/app/components/section/plantuml/type-editor.js +++ b/gui/app/components/section/plantuml/type-editor.js @@ -17,11 +17,12 @@ import Component from '@ember/component'; export default Component.extend({ appMeta: service(), sectionSvc: service('section'), + i18n: service(), isDirty: false, waiting: false, diagramText: '', diagramPreview: null, - previewButtonCaption: 'Preview', + previewButtonCaption: '', editorId: computed('page', function () { let page = this.get('page'); return `plantuml-editor-${page.id}`; @@ -34,9 +35,14 @@ export default Component.extend({ return _.isEmpty(this.get('diagramText')); }), + init(...args) { + this._super(...args); + this.previewButtonCaption = this.i18n.localize('preview'); + }, + generatePreview() { this.set('waiting', true); - this.set('previewButtonCaption', 'Generating preview...'); + this.set('previewButtonCaption', this.i18n.localize('preview_wait')); let self = this; let data = { data: this.get('diagramText') }; @@ -45,11 +51,11 @@ export default Component.extend({ this.get('sectionSvc').fetch(this.get('page'), 'preview', data).then(function (response) { self.set('diagramPreview', response.data); self.set('waiting', false); - self.set('previewButtonCaption', 'Preview'); + self.set('previewButtonCaption', this.i18n.localize('preview')); }, function (reason) { // eslint-disable-line no-unused-vars self.set('diagramPreview', null); self.set('waiting', false); - self.set('previewButtonCaption', 'Preview'); + self.set('previewButtonCaption', this.i18n.localize('preview')); }); }); }, diff --git a/gui/app/templates/components/section/papertrail/type-editor.hbs b/gui/app/templates/components/section/papertrail/type-editor.hbs index e5df209a..1ab76fc7 100644 --- a/gui/app/templates/components/section/papertrail/type-editor.hbs +++ b/gui/app/templates/components/section/papertrail/type-editor.hbs @@ -1,6 +1,6 @@ {{layout/logo-heading - title="Papertrail" - desc="Display your cloud-based logs (https://papertrailapp.com)" + title=(localize 'section_papertrail') + desc=(localize 'section_papertrail_explain') icon=constants.Icon.Integrations}} {{#section/base-editor document=document folder=folder page=page busy=waiting @@ -10,9 +10,8 @@
Insert sample diagrams:
+{{localize 'insert'}}
- {{ui/ui-button color=constants.Color.Gray light=true label="Sequence" onClick=(action "onInsertSequence")}} - {{ui/ui-button color=constants.Color.Gray light=true label="Use Case" onClick=(action "onInsertUseCase")}} - {{ui/ui-button color=constants.Color.Gray light=true label="Class" onClick=(action "onInsertClass")}} - {{ui/ui-button color=constants.Color.Gray light=true label="Activity" onClick=(action "onInsertActivity")}} - {{ui/ui-button color=constants.Color.Gray light=true label="Activity (new syntax)" onClick=(action "onInsertActivityNew")}} - {{ui/ui-button color=constants.Color.Gray light=true label="Component" onClick=(action "onInsertComponent")}} - {{ui/ui-button color=constants.Color.Gray light=true label="State" onClick=(action "onInsertState")}} + {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_sequence') onClick=(action "onInsertSequence")}} + {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_usecase') onClick=(action "onInsertUseCase")}} + {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_class') onClick=(action "onInsertClass")}} + {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_activity') onClick=(action "onInsertActivity")}} + {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_activity2') onClick=(action "onInsertActivityNew")}} + {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_component') onClick=(action "onInsertComponent")}} + {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_state') onClick=(action "onInsertState")}}