From 3d94808c00f5f3c35568a4b9c0584d5f0215bf6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 5 Nov 2014 22:46:07 +0100 Subject: [PATCH] UX: add the word it's before standard spam names to form a complete sentence --- .../discourse/controllers/flag-action-type.js.es6 | 8 ++++++-- config/locales/client.en.yml | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/flag-action-type.js.es6 b/app/assets/javascripts/discourse/controllers/flag-action-type.js.es6 index f4b2fd84d..888f55c3e 100644 --- a/app/assets/javascripts/discourse/controllers/flag-action-type.js.es6 +++ b/app/assets/javascripts/discourse/controllers/flag-action-type.js.es6 @@ -18,8 +18,12 @@ export default ObjectController.extend({ }.property('name_key'), formattedName: function(){ - return this.get('name').replace("{{username}}", this.get('controllers.flag.username')); - }.property('name'), + if (this.get("is_custom_flag")) { + return this.get('name').replace("{{username}}", this.get('controllers.flag.username')); + } else { + return I18n.t("flagging.formatted_name." + this.get('name_key')); + } + }.property('name', 'name_key', 'is_custom_flag'), selected: function() { return this.get('model') === this.get('controllers.flag.selected'); diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 81ac6b122..c6e67eeba 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1324,6 +1324,10 @@ en: submit_tooltip: "Submit the private flag" take_action_tooltip: "Reach the flag threshold immediately, rather than waiting for more community flags" cant: "Sorry, you can't flag this post at this time." + formatted_name: + off_topic: "It's Off-Topic" + inappropriate: "It's Inappropriate" + spam: "It's Spam" custom_placeholder_notify_user: "Why does this post require you to speak to this user directly and privately? Be specific, be constructive, and always be kind." custom_placeholder_notify_moderators: "Why does this post require moderator attention? Let us know specifically what you are concerned about, and provide relevant links where possible." custom_message: