1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00

i18n admin strings

This commit is contained in:
McMatts 2022-03-03 19:42:37 -05:00
parent 53297f7627
commit 4ab48cc67d
11 changed files with 65 additions and 34 deletions

View file

@ -23,6 +23,7 @@ import Component from '@ember/component';
export default Component.extend(ModalMixin, Notifier, { export default Component.extend(ModalMixin, Notifier, {
appMeta: service(), appMeta: service(),
globalSvc: service('global'), globalSvc: service('global'),
i18n: service(),
isDocumizeProvider: computed('authProvider', function() { isDocumizeProvider: computed('authProvider', function() {
return this.get('authProvider') === this.get('constants').AuthProvider.Documize; 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 provider = this.get('authProvider');
let constants = this.get('constants'); 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) { switch (provider) {
case constants.AuthProvider.Documize: { case constants.AuthProvider.Documize: {
@ -176,7 +177,7 @@ export default Component.extend(ModalMixin, Notifier, {
this.get('globalSvc').previewLDAP(config).then((preview) => { this.get('globalSvc').previewLDAP(config).then((preview) => {
this.set('ldapPreview', preview); this.set('ldapPreview', preview);
this.modalOpen("#ldap-preview-modal", {"show": true}); 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'));
}); });
} }
} }

View file

@ -18,16 +18,18 @@ import Component from '@ember/component';
export default Component.extend(Notifier, Modal, { export default Component.extend(Notifier, Modal, {
appMeta: service(), appMeta: service(),
router: service(), router: service(),
i18n: service(),
browserSvc: service('browser'), browserSvc: service('browser'),
backupLabel: 'Backup', backupLabel: '',
backupSystemLabel: 'System Backup', backupSystemLabel: '',
backupSpec: null, backupSpec: null,
backupFilename: '', backupFilename: '',
backupError: false, backupError: false,
backupSuccess: false, backupSuccess: false,
backupRunning: false, backupRunning: false,
restoreSpec: null, restoreSpec: null,
restoreButtonLabel: 'Restore', restoreButtonLabel: '',
restoreUploadReady: false, restoreUploadReady: false,
confirmRestore: '', confirmRestore: '',
@ -53,6 +55,10 @@ export default Component.extend(Notifier, Modal, {
didInsertElement() { didInsertElement() {
this._super(...arguments); 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(){ $('#restore-file').on('change', function(){
var fileName = document.getElementById("restore-file").files[0].name; var fileName = document.getElementById("restore-file").files[0].name;
$(this).next('.custom-file-label').html(fileName); $(this).next('.custom-file-label').html(fileName);
@ -69,13 +75,13 @@ export default Component.extend(Notifier, Modal, {
this.get('onBackup')(spec).then((filename) => { this.get('onBackup')(spec).then((filename) => {
this.notifySuccess('Completed'); this.notifySuccess('Completed');
this.set('backupLabel', 'Start Backup'); this.set('backupLabel', this.i18n.localize('backup_start'));
this.set('backupSuccess', true); this.set('backupSuccess', true);
this.set('backupFilename', filename); this.set('backupFilename', filename);
this.set('backupRunning', false); this.set('backupRunning', false);
}, ()=> { }, ()=> {
this.notifyError('Failed'); this.notifyError('Failed');
this.set('backupLabel', 'Run Backup'); this.set('backupLabel', this.i18n.localize('backup_run'));
this.set('backupFailed', true); this.set('backupFailed', true);
this.set('backupRunning', false); this.set('backupRunning', false);
}); });
@ -133,7 +139,7 @@ export default Component.extend(Notifier, Modal, {
} }
// start restore process // start restore process
this.set('restoreButtonLabel', 'Please wait, restore running...'); this.set('restoreButtonLabel', this.i18n.localize('restore_running'));
this.set('restoreSuccess', false); this.set('restoreSuccess', false);
this.set('restoreFailed', false); this.set('restoreFailed', false);
@ -145,13 +151,13 @@ export default Component.extend(Notifier, Modal, {
} }
this.get('onRestore')(spec, filedata).then(() => { this.get('onRestore')(spec, filedata).then(() => {
this.notifySuccess('Completed'); this.notifySuccess(this.i18n.localize('completed'));
this.set('backupLabel', 'Restore'); this.set('backupLabel', this.i18n.localize('restore'));
this.set('restoreSuccess', true); this.set('restoreSuccess', true);
this.get('router').transitionTo('auth.logout'); this.get('router').transitionTo('auth.logout');
}, ()=> { }, ()=> {
this.notifyError('Failed'); this.notifyError('Failed');
this.set('restorbackupLabel', 'Restore'); this.set('restorbackupLabel', this.i18n.localize('restore'));
this.set('restoreFailed', true); this.set('restoreFailed', true);
}); });
}, },

View file

@ -68,7 +68,7 @@ export default Component.extend(Notifier, {
}); });
this.on("queuecomplete", function () { this.on("queuecomplete", function () {
self.notifySuccess('Logo uploaded'); self.notifySuccess(this.i18n.localize('saved'));
}); });
this.on("error", function (error, msg) { this.on("error", function (error, msg) {
@ -191,7 +191,6 @@ export default Component.extend(Notifier, {
set(this, 'messageError', false); set(this, 'messageError', false);
set(this, 'conversionEndpointError', false); set(this, 'conversionEndpointError', false);
if (domainChanged) { if (domainChanged) {
let router = this.get('router'); let router = this.get('router');
router.transitionTo('auth.login'); router.transitionTo('auth.login');
@ -206,7 +205,7 @@ export default Component.extend(Notifier, {
onDefaultLogo() { onDefaultLogo() {
this.get('onDefaultLogo')(this.get('appMeta.orgId')); this.get('onDefaultLogo')(this.get('appMeta.orgId'));
this.notifySuccess('Using default logo'); this.notifySuccess(this.i18n.localize('saved'));
} }
} }
}); });

View file

@ -61,7 +61,7 @@ export default Component.extend(Notifier, {
this.get('orgSvc').saveGlobalSetting('SECTION-TRELLO', this.get('trelloCreds')); this.get('orgSvc').saveGlobalSetting('SECTION-TRELLO', this.get('trelloCreds'));
} }
this.notifySuccess('Saved'); this.notifySuccess(this.i18n.localize('saved'));
}); });
} }
} }

View file

@ -22,10 +22,13 @@ export default Component.extend(Notifier, Modals, {
subscription: null, subscription: null,
planCloud: false, planCloud: false,
planSelfhost: false, planSelfhost: false,
comment: 'Nothing in particular -- just passing through. Please close my Documize account.', comment: '',
didReceiveAttrs() { didReceiveAttrs() {
this._super(...arguments); this._super(...arguments);
this.set('comment', this.i18n.localize('close_account'));
this.get('global').getSubscription().then((subs) => { this.get('global').getSubscription().then((subs) => {
this.set('subscription', subs); this.set('subscription', subs);
if (subs.plan === 'Installed') { if (subs.plan === 'Installed') {
@ -41,7 +44,7 @@ export default Component.extend(Notifier, Modals, {
actions: { actions: {
saveLicense() { saveLicense() {
this.get('global').setLicense(this.get('license')).then(() => { this.get('global').setLicense(this.get('license')).then(() => {
this.notifySuccess('Saved'); this.notifySuccess(this.i18n.localize('saved'));
window.location.reload(); window.location.reload();
}); });
}, },
@ -55,7 +58,7 @@ export default Component.extend(Notifier, Modals, {
let comment = this.get('comment'); let comment = this.get('comment');
this.get('global').deactivate(comment).then(() => { this.get('global').deactivate(comment).then(() => {
this.notifySuccess('Saved'); this.notifySuccess(this.i18n.localize('saved'));
this.modalOpen("#deactivation-confirmation-modal", {"show": true}); this.modalOpen("#deactivation-confirmation-modal", {"show": true});
}); });
} }

View file

@ -17,14 +17,20 @@ import Component from '@ember/component';
export default Component.extend(Notifier, { export default Component.extend(Notifier, {
appMeta: service(), appMeta: service(),
i18n: service(),
SMTPHostEmptyError: empty('model.smtp.host'), SMTPHostEmptyError: empty('model.smtp.host'),
SMTPPortEmptyError: empty('model.smtp.port'), SMTPPortEmptyError: empty('model.smtp.port'),
SMTPSenderEmptyError: empty('model.smtp.sender'), SMTPSenderEmptyError: empty('model.smtp.sender'),
senderNameError: empty('model.smtp.senderName'), senderNameError: empty('model.smtp.senderName'),
buttonText: 'Save & Test', buttonText: 'Save & Test',
testSMTP: null, testSMTP: null,
init() {
this._super(...arguments);
this.buttonText = this.i18n.localize('smtp_save_test');
},
actions: { actions: {
saveSMTP() { saveSMTP() {
if (this.get('SMTPHostEmptyError')) { if (this.get('SMTPHostEmptyError')) {
@ -50,11 +56,11 @@ export default Component.extend(Notifier, {
}, },
); );
this.set('buttonText', 'Please wait...'); this.set('buttonText', this.i18n.localize('please_test'));
this.notifyInfo('Sending test email to you'); this.notifyInfo(this.i18n.localize('smtp_sent_test_email'));
this.get('saveSMTP')().then((result) => { 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('testSMTP', result);
this.set('appMeta.configured', true); this.set('appMeta.configured', true);

View file

@ -20,6 +20,7 @@ export default Component.extend(Notifier, Modals, {
spaceSvc: service('folder'), spaceSvc: service('folder'),
browserSvc: service('browser'), browserSvc: service('browser'),
documentSvc: service('document'), documentSvc: service('document'),
i18n: service(),
spaces: null, spaces: null,
label: computed('model', function() { label: computed('model', function() {
@ -75,7 +76,7 @@ export default Component.extend(Notifier, Modals, {
this.set('deleteSpace.id', ''); this.set('deleteSpace.id', '');
this.set('deleteSpace.name', ''); this.set('deleteSpace.name', '');
this.loadData(); this.loadData();
this.notifySuccess('Deleted'); this.notifySuccess(this.i18n.localize('deleted'));
}); });
}, },
@ -86,17 +87,17 @@ export default Component.extend(Notifier, Modals, {
filterType: 'space', filterType: 'space',
}; };
this.notifyInfo('Export running...'); this.notifyInfo(this.i18n.localize('space_admin_export_running'));
this.get('documentSvc').export(spec).then((htmlExport) => { this.get('documentSvc').export(spec).then((htmlExport) => {
this.get('browserSvc').downloadFile(htmlExport, 'documize.html'); this.get('browserSvc').downloadFile(htmlExport, 'documize-community.html');
this.notifySuccess('Export completed'); this.notifySuccess(this.i18n.localize('completed'));
}); });
}, },
onOwner(spaceId) { onOwner(spaceId) {
this.get('spaceSvc').grantOwnerPermission(spaceId).then(() => { /* jshint ignore:line */ this.get('spaceSvc').grantOwnerPermission(spaceId).then(() => { /* jshint ignore:line */
this.notifySuccess('Added as owner'); this.notifySuccess(this.i18n.localize('completed'));
}); });
} }
} }

View file

@ -15,10 +15,12 @@ import ModalMixin from '../../mixins/modal';
import Notifier from '../../mixins/notifier'; import Notifier from '../../mixins/notifier';
import stringUtil from '../../utils/string'; import stringUtil from '../../utils/string';
import Component from '@ember/component'; import Component from '@ember/component';
import { inject as service } from '@ember/service';
export default Component.extend(AuthProvider, ModalMixin, Notifier, { export default Component.extend(AuthProvider, ModalMixin, Notifier, {
bulkUsers: '', bulkUsers: '',
newUser: null, newUser: null,
i18n: service(),
init() { init() {
this._super(...arguments); this._super(...arguments);
@ -53,7 +55,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, {
this.get('onAddUser')(user).then(() => { this.get('onAddUser')(user).then(() => {
this.set('newUser', { firstname: '', lastname: '', email: '', active: true }); this.set('newUser', { firstname: '', lastname: '', email: '', active: true });
this.notifySuccess('Added user'); this.notifySuccess(this.i18n.localize('added'));
}); });
this.modalClose("#add-user-modal"); this.modalClose("#add-user-modal");
@ -68,7 +70,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, {
this.get('onAddUsers')(this.get('bulkUsers')).then(() => { this.get('onAddUsers')(this.get('bulkUsers')).then(() => {
this.set('bulkUsers', ''); this.set('bulkUsers', '');
this.notifySuccess('Added users'); this.notifySuccess(this.i18n.localize('added'));
}); });
this.modalClose("#add-user-modal"); this.modalClose("#add-user-modal");

View file

@ -174,7 +174,7 @@ export default Component.extend(AuthProvider, ModalMixin, {
}, },
onSearch() { onSearch() {
debounce(this, function() { this.loadGroupInfo(); }, 450); debounce(this, this.loadGroupInfo, 450);
}, },
onLeaveGroup(userId) { onLeaveGroup(userId) {

View file

@ -20,6 +20,8 @@ import Component from '@ember/component';
export default Component.extend(AuthProvider, ModalMixin, Notifier, { export default Component.extend(AuthProvider, ModalMixin, Notifier, {
groupSvc: service('group'), groupSvc: service('group'),
i18n: service(),
editUser: null, editUser: null,
deleteUser: null, deleteUser: null,
filter: '', filter: '',
@ -183,7 +185,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, {
let cb = this.get('onDelete'); let cb = this.get('onDelete');
cb(this.get('deleteUser.id')); cb(this.get('deleteUser.id'));
this.notifySuccess("Deleted user"); this.notifySuccess(this.i18n.localize('deleted'));
return true; return true;
}, },
@ -203,7 +205,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, {
this.set('selectedUsers', []); this.set('selectedUsers', []);
this.set('hasSelectedUsers', false); this.set('hasSelectedUsers', false);
this.notifySuccess("Deleted selected users"); this.notifySuccess(this.i18n.localize('deleted'));
this.modalClose('#admin-user-delete-modal'); this.modalClose('#admin-user-delete-modal');
}, },

View file

@ -34,7 +34,6 @@
"rejected": "Rejected", "rejected": "Rejected",
"reply": "Reply", "reply": "Reply",
"reset": "Reset", "reset": "Reset",
"restore": "Restore",
"request": "Request", "request": "Request",
"save": "Save", "save": "Save",
"saved": "Saved", "saved": "Saved",
@ -66,6 +65,10 @@
"password_confirm": "Confirm Password", "password_confirm": "Confirm Password",
"encryption": "Encryption", "encryption": "Encryption",
"notice": "Notice", "notice": "Notice",
"backup": "Backup",
"restore": "Restore",
"completed": "Completed",
"please_wait": "Please wait..",
"filter": "Filter", "filter": "Filter",
"all": "All", "all": "All",
@ -107,10 +110,13 @@
"backup_system": "Backup System", "backup_system": "Backup System",
"backup_failed": "Backup failed -- please check server logs", "backup_failed": "Backup failed -- please check server logs",
"backup_success": "Backup successful", "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_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_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_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_select_file": "Choose backup file",
"restore_running": "Please wait, restore running...",
"restore_failed": "Restore failed -- please check server logs", "restore_failed": "Restore failed -- please check server logs",
"restore_success": "Restore completed -- restart your browser and log in", "restore_success": "Restore completed -- restart your browser and log in",
"restore_confirm": "Confirm Restore", "restore_confirm": "Confirm Restore",
@ -163,7 +169,10 @@
"smtp_anon_auth": "Anonymous Authentication (Ignore Credentials)", "smtp_anon_auth": "Anonymous Authentication (Ignore Credentials)",
"smtp_base64": "Base64 Encode Credentials", "smtp_base64": "Base64 Encode Credentials",
"smtp_ssl": "Use SSL", "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": "Export All Content",
"space_admin_export_running": "Export running....",
"space_admin_make_owner": "Add myself as owner", "space_admin_make_owner": "Add myself as owner",
"space_admin_delete": "Delete space", "space_admin_delete": "Delete space",
"space_admin_empty": "There are no shared spaces to manage", "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_group_explain2": "Group Attributes used to retreive data when using Group Filter",
"auth_ldap_preview": "LDAP Preview", "auth_ldap_preview": "LDAP Preview",
"auth_ldap_preview_result": "Connection successful, found {1} users.", "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": "CAS Server URL",
"auth_cas_url_explain": "e.g. http://localhost:8888/auth", "auth_cas_url_explain": "e.g. http://localhost:8888/auth",
"auth_cas_back_url": "Documize CAS URL", "auth_cas_back_url": "Documize CAS URL",
@ -284,5 +294,6 @@
"admin_labels_explain": "Group and navigate spaces with visual labels", "admin_labels_explain": "Group and navigate spaces with visual labels",
"admin_search_explain": "Rebuild the search index", "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" "third_party": "Documize Community utilizes open source libraries and components from third parties"
} }