From b2f07984df8f3d4b39b4851453eca518b4d867a8 Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 25 May 2016 18:57:06 -0700 Subject: [PATCH] i18n unregistered user errors // FREEBIE --- _locales/en/messages.json | 4 ++++ js/views/message_view.js | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 3f633791..9350bbf5 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -280,5 +280,9 @@ "mediaMessage": { "message": "Media message", "description": "Description of a message that has an attachment and no text, displayed in the conversation list as a preview." + }, + "unregisteredUser": { + "message": "Number is not registered", + "description": "Error message displayed when sending to an unregistered user." } } diff --git a/js/views/message_view.js b/js/views/message_view.js index 43b58c71..f6146f7b 100644 --- a/js/views/message_view.js +++ b/js/views/message_view.js @@ -11,7 +11,12 @@ templateName: 'error-icon', className: 'error-icon-container', render_attributes: function() { - return { message: this.model && this.model.message }; + var message; + if (this.model.name === 'UnregisteredUserError') { + message = i18n('unregisteredUser'); + this.$el.addClass('unregistered-user-error'); + } + return { message: message }; } }); var NetworkErrorView = Whisper.View.extend({