From fff0f31a664acfdbff0ddd1a18e441dce0ee3514 Mon Sep 17 00:00:00 2001 From: Tulio Casagrande Date: Tue, 28 Jun 2016 19:11:17 -0300 Subject: Normalize i18n keys --- web-ui/app/js/mail_view/ui/no_mails_available_pane.js | 4 ++-- web-ui/app/js/mail_view/ui/send_button.js | 2 +- web-ui/app/js/mixins/with_mail_edit_base.js | 2 +- web-ui/app/js/services/mail_service.js | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'web-ui/app/js') diff --git a/web-ui/app/js/mail_view/ui/no_mails_available_pane.js b/web-ui/app/js/mail_view/ui/no_mails_available_pane.js index 5f083685..c62c6b30 100644 --- a/web-ui/app/js/mail_view/ui/no_mails_available_pane.js +++ b/web-ui/app/js/mail_view/ui/no_mails_available_pane.js @@ -37,8 +37,8 @@ define( var mailsQueryMatch = /-?in:"?[\w]+"?|tag:"[\w]+"/g; this.render = function() { - this.attr.tag = this.attr.tag.toUpperCase(); - this.attr.forSearch = this.attr.forSearch.replace(mailsQueryMatch, '').trim().toUpperCase(); + this.attr.tag = 'tags.' + this.attr.tag; + this.attr.forSearch = this.attr.forSearch.replace(mailsQueryMatch, '').trim(); this.$node.html(templates.noMailsAvailable(this.attr)); }; diff --git a/web-ui/app/js/mail_view/ui/send_button.js b/web-ui/app/js/mail_view/ui/send_button.js index 581a244a..66fe1233 100644 --- a/web-ui/app/js/mail_view/ui/send_button.js +++ b/web-ui/app/js/mail_view/ui/send_button.js @@ -99,7 +99,7 @@ define([ this.resetButton = function () { this.attr.sendingInProgress = false; this.attr.uploading = false; - this.$node.html(viewHelper.i18n.t('send-button')); + this.$node.html(viewHelper.i18n.t('send')); this.enableButton(); }; diff --git a/web-ui/app/js/mixins/with_mail_edit_base.js b/web-ui/app/js/mixins/with_mail_edit_base.js index a60cce03..a088080e 100644 --- a/web-ui/app/js/mixins/with_mail_edit_base.js +++ b/web-ui/app/js/mixins/with_mail_edit_base.js @@ -147,7 +147,7 @@ define( } else { this.trigger( events.ui.userAlerts.displayMessage, - {message: i18n.t('One or more of the recipients are not valid emails')} + {message: i18n.t('recipients-not-valid')} ); this.trigger(events.mail.send_failed); } diff --git a/web-ui/app/js/services/mail_service.js b/web-ui/app/js/services/mail_service.js index bc56daf8..5e4bd4f3 100644 --- a/web-ui/app/js/services/mail_service.js +++ b/web-ui/app/js/services/mail_service.js @@ -60,9 +60,9 @@ define( }; var failure = function (resp) { - var msg = i18n.t('Could not update mail tags'); + var msg = i18n.t('failed-change-tags'); if (resp.status === 403) { - msg = i18n.t('Invalid tag name'); + msg = i18n.t('invalid-tag-name'); } this.trigger(document, events.ui.userAlerts.displayMessage, { message: msg }); }; @@ -151,14 +151,14 @@ define( contentType: 'application/json; charset=utf-8', data: JSON.stringify({idents: mailIdents}) }).done(this.triggerArchived(dataToArchive)) - .fail(this.errorMessage(i18n.t('could-not-archive'))); + .fail(this.errorMessage(i18n.t('failed-archive'))); }; this.deleteMail = function (ev, data) { monitoredAjax(this, '/mail/' + data.mail.ident, {type: 'DELETE'}) .done(this.triggerDeleted(data)) - .fail(this.errorMessage(i18n.t('Could not delete email'))); + .fail(this.errorMessage(i18n.t('failed-delete-single'))); }; this.deleteManyMails = function (ev, data) { @@ -173,7 +173,7 @@ define( contentType: 'application/json; charset=utf-8', data: JSON.stringify({idents: mailIdents}) }).done(this.triggerDeleted(dataToDelete)) - .fail(this.errorMessage(i18n.t('Could not delete emails'))); + .fail(this.errorMessage(i18n.t('failed-delete-bulk'))); }; this.recoverManyMails = function (ev, data) { @@ -246,7 +246,7 @@ define( this.trigger(document, events.mails.available, _.merge({tag: this.attr.currentTag, forSearch: this.attr.lastQuery }, this.parseMails(data))); }.bind(this)) .fail(function () { - this.trigger(document, events.ui.userAlerts.displayMessage, { message: i18n.t('Could not fetch messages'), class: 'error' }); + this.trigger(document, events.ui.userAlerts.displayMessage, { message: i18n.t('failed-fetch-messages'), class: 'error' }); }.bind(this)); }; -- cgit v1.2.3