mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
i18n admin strings
This commit is contained in:
parent
53297f7627
commit
4ab48cc67d
11 changed files with 65 additions and 34 deletions
|
@ -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'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -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'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -174,7 +174,7 @@ export default Component.extend(AuthProvider, ModalMixin, {
|
|||
},
|
||||
|
||||
onSearch() {
|
||||
debounce(this, function() { this.loadGroupInfo(); }, 450);
|
||||
debounce(this, this.loadGroupInfo, 450);
|
||||
},
|
||||
|
||||
onLeaveGroup(userId) {
|
||||
|
|
|
@ -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');
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue