diff --git a/gui/app/components/customize/auth-settings.js b/gui/app/components/customize/auth-settings.js index 638f45e9..72a9f830 100644 --- a/gui/app/components/customize/auth-settings.js +++ b/gui/app/components/customize/auth-settings.js @@ -23,6 +23,7 @@ import Component from '@ember/component'; export default Component.extend(ModalMixin, Notifier, { appMeta: service(), globalSvc: service('global'), + i18n: service(), isDocumizeProvider: computed('authProvider', function() { return this.get('authProvider') === this.get('constants').AuthProvider.Documize; @@ -90,7 +91,7 @@ export default Component.extend(ModalMixin, Notifier, { let provider = this.get('authProvider'); let constants = this.get('constants'); - this.set('ldapPreview', {isError: true, message: 'Unable to connect'}); + this.set('ldapPreview', {isError: true, message: this.i18n.localize('auth_ldap_preview_error')}); switch (provider) { case constants.AuthProvider.Documize: { @@ -176,7 +177,7 @@ export default Component.extend(ModalMixin, Notifier, { this.get('globalSvc').previewLDAP(config).then((preview) => { this.set('ldapPreview', preview); this.modalOpen("#ldap-preview-modal", {"show": true}); - this.notifySuccess('Saved'); + this.notifySuccess(this.i18n.localize('saved')); }); }, @@ -314,7 +315,7 @@ export default Component.extend(ModalMixin, Notifier, { }); } - this.notifySuccess('Saved'); + this.notifySuccess(this.i18n.localize('saved')); }); } } diff --git a/gui/app/components/customize/backup-restore.js b/gui/app/components/customize/backup-restore.js index fca96b28..434d8b6b 100644 --- a/gui/app/components/customize/backup-restore.js +++ b/gui/app/components/customize/backup-restore.js @@ -18,16 +18,18 @@ import Component from '@ember/component'; export default Component.extend(Notifier, Modal, { appMeta: service(), router: service(), + i18n: service(), + browserSvc: service('browser'), - backupLabel: 'Backup', - backupSystemLabel: 'System Backup', + backupLabel: '', + backupSystemLabel: '', backupSpec: null, backupFilename: '', backupError: false, backupSuccess: false, backupRunning: false, restoreSpec: null, - restoreButtonLabel: 'Restore', + restoreButtonLabel: '', restoreUploadReady: false, confirmRestore: '', @@ -53,6 +55,10 @@ export default Component.extend(Notifier, Modal, { didInsertElement() { this._super(...arguments); + this.set('backupLabel', this.i18n.localize('backup')); + this.set('backupSystemLabel', this.i18n.localize('backup_system')); + this.set('restoreButtonLabel', this.i18n.localize('restore')) + $('#restore-file').on('change', function(){ var fileName = document.getElementById("restore-file").files[0].name; $(this).next('.custom-file-label').html(fileName); @@ -69,13 +75,13 @@ export default Component.extend(Notifier, Modal, { this.get('onBackup')(spec).then((filename) => { this.notifySuccess('Completed'); - this.set('backupLabel', 'Start Backup'); + this.set('backupLabel', this.i18n.localize('backup_start')); this.set('backupSuccess', true); this.set('backupFilename', filename); this.set('backupRunning', false); }, ()=> { this.notifyError('Failed'); - this.set('backupLabel', 'Run Backup'); + this.set('backupLabel', this.i18n.localize('backup_run')); this.set('backupFailed', true); this.set('backupRunning', false); }); @@ -133,7 +139,7 @@ export default Component.extend(Notifier, Modal, { } // start restore process - this.set('restoreButtonLabel', 'Please wait, restore running...'); + this.set('restoreButtonLabel', this.i18n.localize('restore_running')); this.set('restoreSuccess', false); this.set('restoreFailed', false); @@ -145,13 +151,13 @@ export default Component.extend(Notifier, Modal, { } this.get('onRestore')(spec, filedata).then(() => { - this.notifySuccess('Completed'); - this.set('backupLabel', 'Restore'); + this.notifySuccess(this.i18n.localize('completed')); + this.set('backupLabel', this.i18n.localize('restore')); this.set('restoreSuccess', true); this.get('router').transitionTo('auth.logout'); }, ()=> { this.notifyError('Failed'); - this.set('restorbackupLabel', 'Restore'); + 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 40d12832..350c7cd3 100644 --- a/gui/app/components/customize/general-settings.js +++ b/gui/app/components/customize/general-settings.js @@ -68,7 +68,7 @@ export default Component.extend(Notifier, { }); this.on("queuecomplete", function () { - self.notifySuccess('Logo uploaded'); + self.notifySuccess(this.i18n.localize('saved')); }); this.on("error", function (error, msg) { @@ -191,7 +191,6 @@ export default Component.extend(Notifier, { set(this, 'messageError', false); set(this, 'conversionEndpointError', false); - if (domainChanged) { let router = this.get('router'); router.transitionTo('auth.login'); @@ -206,7 +205,7 @@ export default Component.extend(Notifier, { onDefaultLogo() { this.get('onDefaultLogo')(this.get('appMeta.orgId')); - this.notifySuccess('Using default logo'); + this.notifySuccess(this.i18n.localize('saved')); } } }); diff --git a/gui/app/components/customize/integration-settings.js b/gui/app/components/customize/integration-settings.js index 275588cb..7cc06601 100644 --- a/gui/app/components/customize/integration-settings.js +++ b/gui/app/components/customize/integration-settings.js @@ -61,7 +61,7 @@ export default Component.extend(Notifier, { this.get('orgSvc').saveGlobalSetting('SECTION-TRELLO', this.get('trelloCreds')); } - this.notifySuccess('Saved'); + this.notifySuccess(this.i18n.localize('saved')); }); } } diff --git a/gui/app/components/customize/license-key.js b/gui/app/components/customize/license-key.js index 266dd432..897c4ebe 100644 --- a/gui/app/components/customize/license-key.js +++ b/gui/app/components/customize/license-key.js @@ -22,10 +22,13 @@ export default Component.extend(Notifier, Modals, { subscription: null, planCloud: false, planSelfhost: false, - comment: 'Nothing in particular -- just passing through. Please close my Documize account.', + comment: '', didReceiveAttrs() { this._super(...arguments); + + this.set('comment', this.i18n.localize('close_account')); + this.get('global').getSubscription().then((subs) => { this.set('subscription', subs); if (subs.plan === 'Installed') { @@ -41,7 +44,7 @@ export default Component.extend(Notifier, Modals, { actions: { saveLicense() { this.get('global').setLicense(this.get('license')).then(() => { - this.notifySuccess('Saved'); + this.notifySuccess(this.i18n.localize('saved')); window.location.reload(); }); }, @@ -55,7 +58,7 @@ export default Component.extend(Notifier, Modals, { let comment = this.get('comment'); this.get('global').deactivate(comment).then(() => { - this.notifySuccess('Saved'); + this.notifySuccess(this.i18n.localize('saved')); this.modalOpen("#deactivation-confirmation-modal", {"show": true}); }); } diff --git a/gui/app/components/customize/smtp-settings.js b/gui/app/components/customize/smtp-settings.js index fcf2f7e3..0cc7c697 100644 --- a/gui/app/components/customize/smtp-settings.js +++ b/gui/app/components/customize/smtp-settings.js @@ -17,14 +17,20 @@ import Component from '@ember/component'; export default Component.extend(Notifier, { appMeta: service(), + i18n: service(), + SMTPHostEmptyError: empty('model.smtp.host'), SMTPPortEmptyError: empty('model.smtp.port'), SMTPSenderEmptyError: empty('model.smtp.sender'), senderNameError: empty('model.smtp.senderName'), - buttonText: 'Save & Test', testSMTP: null, + init() { + this._super(...arguments); + this.buttonText = this.i18n.localize('smtp_save_test'); + }, + actions: { saveSMTP() { if (this.get('SMTPHostEmptyError')) { @@ -50,11 +56,11 @@ export default Component.extend(Notifier, { }, ); - this.set('buttonText', 'Please wait...'); - this.notifyInfo('Sending test email to you'); + this.set('buttonText', this.i18n.localize('please_test')); + this.notifyInfo(this.i18n.localize('smtp_sent_test_email')); this.get('saveSMTP')().then((result) => { - this.set('buttonText', 'Save & Test'); + this.set('buttonText', this.i18n.localize('smtp_save_test')); this.set('testSMTP', result); this.set('appMeta.configured', true); diff --git a/gui/app/components/customize/space-admin.js b/gui/app/components/customize/space-admin.js index d1fca565..b1de1325 100644 --- a/gui/app/components/customize/space-admin.js +++ b/gui/app/components/customize/space-admin.js @@ -20,6 +20,7 @@ export default Component.extend(Notifier, Modals, { spaceSvc: service('folder'), browserSvc: service('browser'), documentSvc: service('document'), + i18n: service(), spaces: null, label: computed('model', function() { @@ -75,7 +76,7 @@ export default Component.extend(Notifier, Modals, { this.set('deleteSpace.id', ''); this.set('deleteSpace.name', ''); this.loadData(); - this.notifySuccess('Deleted'); + this.notifySuccess(this.i18n.localize('deleted')); }); }, @@ -86,17 +87,17 @@ export default Component.extend(Notifier, Modals, { filterType: 'space', }; - this.notifyInfo('Export running...'); + this.notifyInfo(this.i18n.localize('space_admin_export_running')); this.get('documentSvc').export(spec).then((htmlExport) => { - this.get('browserSvc').downloadFile(htmlExport, 'documize.html'); - this.notifySuccess('Export completed'); + this.get('browserSvc').downloadFile(htmlExport, 'documize-community.html'); + this.notifySuccess(this.i18n.localize('completed')); }); }, onOwner(spaceId) { this.get('spaceSvc').grantOwnerPermission(spaceId).then(() => { /* jshint ignore:line */ - this.notifySuccess('Added as owner'); + this.notifySuccess(this.i18n.localize('completed')); }); } } diff --git a/gui/app/components/customize/user-admin.js b/gui/app/components/customize/user-admin.js index a1682c15..3ffc3506 100644 --- a/gui/app/components/customize/user-admin.js +++ b/gui/app/components/customize/user-admin.js @@ -15,10 +15,12 @@ import ModalMixin from '../../mixins/modal'; import Notifier from '../../mixins/notifier'; import stringUtil from '../../utils/string'; import Component from '@ember/component'; +import { inject as service } from '@ember/service'; export default Component.extend(AuthProvider, ModalMixin, Notifier, { bulkUsers: '', newUser: null, + i18n: service(), init() { this._super(...arguments); @@ -53,7 +55,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, { this.get('onAddUser')(user).then(() => { this.set('newUser', { firstname: '', lastname: '', email: '', active: true }); - this.notifySuccess('Added user'); + this.notifySuccess(this.i18n.localize('added')); }); this.modalClose("#add-user-modal"); @@ -68,7 +70,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, { this.get('onAddUsers')(this.get('bulkUsers')).then(() => { this.set('bulkUsers', ''); - this.notifySuccess('Added users'); + this.notifySuccess(this.i18n.localize('added')); }); this.modalClose("#add-user-modal"); diff --git a/gui/app/components/customize/user-groups.js b/gui/app/components/customize/user-groups.js index f1136e8f..e8064847 100644 --- a/gui/app/components/customize/user-groups.js +++ b/gui/app/components/customize/user-groups.js @@ -174,7 +174,7 @@ export default Component.extend(AuthProvider, ModalMixin, { }, onSearch() { - debounce(this, function() { this.loadGroupInfo(); }, 450); + debounce(this, this.loadGroupInfo, 450); }, onLeaveGroup(userId) { diff --git a/gui/app/components/customize/user-list.js b/gui/app/components/customize/user-list.js index 29d5f619..3455756d 100644 --- a/gui/app/components/customize/user-list.js +++ b/gui/app/components/customize/user-list.js @@ -20,6 +20,8 @@ import Component from '@ember/component'; export default Component.extend(AuthProvider, ModalMixin, Notifier, { groupSvc: service('group'), + i18n: service(), + editUser: null, deleteUser: null, filter: '', @@ -183,7 +185,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, { let cb = this.get('onDelete'); cb(this.get('deleteUser.id')); - this.notifySuccess("Deleted user"); + this.notifySuccess(this.i18n.localize('deleted')); return true; }, @@ -203,7 +205,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, { this.set('selectedUsers', []); this.set('hasSelectedUsers', false); - this.notifySuccess("Deleted selected users"); + this.notifySuccess(this.i18n.localize('deleted')); this.modalClose('#admin-user-delete-modal'); }, diff --git a/gui/public/i18n/en-US.json b/gui/public/i18n/en-US.json index 15a21dbb..c21b6a12 100644 --- a/gui/public/i18n/en-US.json +++ b/gui/public/i18n/en-US.json @@ -34,7 +34,6 @@ "rejected": "Rejected", "reply": "Reply", "reset": "Reset", - "restore": "Restore", "request": "Request", "save": "Save", "saved": "Saved", @@ -66,6 +65,10 @@ "password_confirm": "Confirm Password", "encryption": "Encryption", "notice": "Notice", + "backup": "Backup", + "restore": "Restore", + "completed": "Completed", + "please_wait": "Please wait..", "filter": "Filter", "all": "All", @@ -107,10 +110,13 @@ "backup_system": "Backup System", "backup_failed": "Backup failed -- please check server logs", "backup_success": "Backup successful", + "backup_start": "Start Backup", + "backup_run": "Run Backup", "restore_explain1": "Restore from a system backup should only be performed on an empty Documize Community database.", "restore_explain2": "Restore operation will re-create users, groups, permissions, spaces, categories and content.", "restore_explain3": "It can take several minutes to complete the restore process -- please be patient while the restore operation is in progress.", "restore_select_file": "Choose backup file", + "restore_running": "Please wait, restore running...", "restore_failed": "Restore failed -- please check server logs", "restore_success": "Restore completed -- restart your browser and log in", "restore_confirm": "Confirm Restore", @@ -163,7 +169,10 @@ "smtp_anon_auth": "Anonymous Authentication (Ignore Credentials)", "smtp_base64": "Base64 Encode Credentials", "smtp_ssl": "Use SSL", + "smtp_save_test": "Save & Test", + "smtp_sent_test_email": "Sending test email to you", "space_admin_export": "Export All Content", + "space_admin_export_running": "Export running....", "space_admin_make_owner": "Add myself as owner", "space_admin_delete": "Delete space", "space_admin_empty": "There are no shared spaces to manage", @@ -258,6 +267,7 @@ "auth_ldap_group_explain2": "Group Attributes used to retreive data when using Group Filter", "auth_ldap_preview": "LDAP Preview", "auth_ldap_preview_result": "Connection successful, found {1} users.", + "auth_ldap_preview_error": "Unable to connect", "auth_cas_url": "CAS Server URL", "auth_cas_url_explain": "e.g. http://localhost:8888/auth", "auth_cas_back_url": "Documize CAS URL", @@ -284,5 +294,6 @@ "admin_labels_explain": "Group and navigate spaces with visual labels", "admin_search_explain": "Rebuild the search index", + "close_account": "Please close my Documize account.", "third_party": "Documize Community utilizes open source libraries and components from third parties" }