diff --git a/gui/app/components/customize/backup-restore.js b/gui/app/components/customize/backup-restore.js index 434d8b6b..06b461b2 100644 --- a/gui/app/components/customize/backup-restore.js +++ b/gui/app/components/customize/backup-restore.js @@ -74,13 +74,13 @@ export default Component.extend(Notifier, Modal, { let spec = this.get('backupSpec'); this.get('onBackup')(spec).then((filename) => { - this.notifySuccess('Completed'); + this.notifySuccess(this.i18n.localize('completed')); this.set('backupLabel', this.i18n.localize('backup_start')); this.set('backupSuccess', true); this.set('backupFilename', filename); this.set('backupRunning', false); }, ()=> { - this.notifyError('Failed'); + this.notifyError(this.i18n.localize('backup_failed')); this.set('backupLabel', this.i18n.localize('backup_run')); this.set('backupFailed', true); this.set('backupRunning', false); @@ -156,7 +156,7 @@ export default Component.extend(Notifier, Modal, { this.set('restoreSuccess', true); this.get('router').transitionTo('auth.logout'); }, ()=> { - this.notifyError('Failed'); + this.notifyError(this.i18n.localize('backup_failed')); this.set('restorbackupLabel', this.i18n.localize('restore')); this.set('restoreFailed', true); }); diff --git a/gui/app/components/customize/general-settings.js b/gui/app/components/customize/general-settings.js index 350c7cd3..4cd85041 100644 --- a/gui/app/components/customize/general-settings.js +++ b/gui/app/components/customize/general-settings.js @@ -21,6 +21,7 @@ import Component from '@ember/component'; export default Component.extend(Notifier, { appMeta: service(), router: service(), + i18n: service(), maxTags: 3, domain: '', titleEmpty: empty('model.general.title'), @@ -186,7 +187,7 @@ export default Component.extend(Notifier, { this.set('model.general.domain', this.get('domain').toLowerCase()); this.get('onUpdate')().then(() => { - this.notifySuccess('Saved'); + this.notifySuccess(this.i18n.localize('saved')); set(this, 'titleError', false); set(this, 'messageError', false); set(this, 'conversionEndpointError', false); diff --git a/gui/app/components/document/page-heading.js b/gui/app/components/document/page-heading.js index 0fc47ba4..94fd6c41 100644 --- a/gui/app/components/document/page-heading.js +++ b/gui/app/components/document/page-heading.js @@ -23,6 +23,7 @@ export default Component.extend(Notifier, ModalMixin, { searchService: service('search'), router: service(), appMeta: service(), + i18n: service(), deleteChildren: false, blockTitle: "", blockExcerpt: "", @@ -84,7 +85,7 @@ export default Component.extend(Notifier, ModalMixin, { let clip = new ClipboardJS('#page-copy-link-' + pageId, { text: function() { - self.notifySuccess('Link copied to clipboard'); + self.notifySuccess(this.i18n.localize('copied')); return url; } }); diff --git a/gui/app/components/folder/settings-permissions.js b/gui/app/components/folder/settings-permissions.js index 4841a710..10607ac8 100644 --- a/gui/app/components/folder/settings-permissions.js +++ b/gui/app/components/folder/settings-permissions.js @@ -285,7 +285,7 @@ export default Component.extend(Notifier, Modals, AuthProvider, { this.set('inviteEmail', ''); this.get('spaceSvc').share(this.get('folder.id'), result).then(() => { - this.notifySuccess('Invites sent'); + this.notifySuccess(this.i18n.localize('sent')); $('#space-invite-email').removeClass('is-invalid'); this.modalClose("#space-invite-user-modal"); this.load(); diff --git a/gui/app/pods/document/index/controller.js b/gui/app/pods/document/index/controller.js index 1d321cbf..5c857d52 100644 --- a/gui/app/pods/document/index/controller.js +++ b/gui/app/pods/document/index/controller.js @@ -22,6 +22,7 @@ export default Controller.extend(Notifier, { localStore: service('local-storage'), appMeta: service(), router: service(), + i18n: service(), sidebarTab: 'toc', queryParams: ['currentPageId', 'source'], contributionStatus: '', @@ -38,7 +39,7 @@ export default Controller.extend(Notifier, { onSaveDocument(doc) { this.get('documentService').save(doc).then(() => { - this.notifySuccess('Saved'); + this.notifySuccess(this.i18n.localize('saved')); }); this.get('browser').setTitle(doc.get('name')); this.get('browser').setMetaDescription(doc.get('excerpt')); @@ -117,7 +118,7 @@ export default Controller.extend(Notifier, { }; this.get('documentService').updatePage(documentId, page.get('id'), model).then((/*up*/) => { - this.notifySuccess('Saved'); + this.notifySuccess(this.i18n.localize('saved')); this.get('documentService').fetchPages(documentId, this.get('session.user.id')).then((pages) => { this.set('pages', pages); @@ -160,7 +161,7 @@ export default Controller.extend(Notifier, { this.get('documentService').addPage(this.get('document.id'), data).then((newPage) => { let data = this.get('store').normalize('page', newPage); this.get('store').push(data); - this.notifySuccess('Inserted'); + this.notifySuccess(this.i18n.localize('saved')); this.get('documentService').fetchPages(this.get('document.id'), this.get('session.user.id')).then((pages) => { this.set('pages', pages); @@ -198,13 +199,13 @@ export default Controller.extend(Notifier, { onSaveTemplate(name, desc) { this.get('templateService').saveAsTemplate(this.get('document.id'), name, desc).then(() => { - this.notifySuccess('Template saved'); + this.notifySuccess(this.i18n.localize('saved')); }); }, onDuplicate(name) { this.get('documentService').duplicate(this.get('folder.id'), this.get('document.id'), name).then(() => { - this.notifySuccess('Duplicated'); + this.notifySuccess(this.i18n.localize('duplicated')); }); }, @@ -232,7 +233,7 @@ export default Controller.extend(Notifier, { let doc = this.get('document'); doc.set('tags', tags); this.get('documentService').save(doc).then(()=> { - this.notifySuccess('Saved'); + this.notifySuccess(this.i18n.localize('saved')); }); }, diff --git a/gui/app/pods/document/settings/controller.js b/gui/app/pods/document/settings/controller.js index a8bee9fe..15cab068 100644 --- a/gui/app/pods/document/settings/controller.js +++ b/gui/app/pods/document/settings/controller.js @@ -19,6 +19,7 @@ export default Controller.extend(Notifier, { folderService: service('folder'), documentService: service('document'), localStorage: service('localStorage'), + i18n: service(), queryParams: ['tab'], tab: 'general', @@ -33,7 +34,7 @@ export default Controller.extend(Notifier, { onSaveDocument(doc) { this.get('documentService').save(doc).then(() => { - this.notifySuccess('Saved'); + this.notifySuccess(this.i18n.localize('saved')); }); this.get('browser').setTitle(doc.get('name')); diff --git a/gui/app/services/link.js b/gui/app/services/link.js index 2b78cbeb..1fe6fff0 100644 --- a/gui/app/services/link.js +++ b/gui/app/services/link.js @@ -18,6 +18,7 @@ export default Service.extend(Notifier, { appMeta: service(), store: service(), eventBus: service(), + i18n: service(), // Returns links within specified document getDocumentLinks(documentId) { @@ -43,7 +44,7 @@ export default Service.extend(Notifier, { }).then((response) => { return response; }); - }, + }, // Returns keyword-based candidates searchCandidates(keywords) { @@ -166,7 +167,7 @@ export default Service.extend(Notifier, { document.execCommand('copy'); document.body.removeChild(el); - this.notifyInfo('Copied location to clipboard'); + this.notifyInfo(this.i18n.localize('copied')); return; } diff --git a/gui/public/i18n/en-US.json b/gui/public/i18n/en-US.json index b98fc113..4e765d0a 100644 --- a/gui/public/i18n/en-US.json +++ b/gui/public/i18n/en-US.json @@ -16,6 +16,7 @@ "deleted": "Deleted", "remove": "Remove", "duplicate": "Duplicate", + "duplicated": "Duplicated", "edit": "Edit", "edited": "Edited", "download": "Download",