diff --git a/app/assets/javascripts/discourse/views/topic_view.js b/app/assets/javascripts/discourse/views/topic_view.js index 5e45e943ac6..dc29b84ac5d 100644 --- a/app/assets/javascripts/discourse/views/topic_view.js +++ b/app/assets/javascripts/discourse/views/topic_view.js @@ -511,11 +511,16 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, { var newTopics = tracking.countNew(); if (newTopics + unreadTopics > 0) { - if(category) { - return I18n.messageFormat("topic.read_more_in_category_MF", {"UNREAD": unreadTopics, "NEW": newTopics, catLink: opts.catLink}) - } else { - return I18n.messageFormat("topic.read_more_MF", {"UNREAD": unreadTopics, "NEW": newTopics, latestLink: opts.latestLink}) - } + var hasBoth = unreadTopics > 0 && newTopics > 0; + + return I18n.messageFormat("topic.read_more_MF", { + "BOTH": hasBoth, + "UNREAD": unreadTopics, + "NEW": newTopics, + "CATEGORY": category ? true : false, + latestLink: opts.latestLink, + catLink: opts.catLink + }); } else if (category) { return Ember.String.i18n("topic.read_more_in_category", opts); diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index ff7ec173bd7..217180d24c2 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -543,8 +543,20 @@ en: read_more: "Want to read more? {{catLink}} or {{latestLink}}." # keys ending with _MF use message format, see /spec/components/js_local_helper_spec.rb for samples - read_more_in_category_MF: "There {UNREAD, plural, one {is 1 unread} other {are # unread}} and {NEW, plural, one {1 new topic} other {# new topics}} remaining, or browse other topics in {catLink}" - read_more_MF: "There {UNREAD, plural, one {is 1 unread} other {are # unread}} and {NEW, plural, one {1 new topic} other {# new topics}} remaining, or {latestLink}" + read_more_MF: "There { + UNREAD, plural, + =0 {} + one { + is 1 unread + } other { + are # unread + } + } { + NEW, plural, + =0 {} + one { {BOTH, select, true{and } false {is } other{}} 1 new topic} + other { {BOTH, select, true{and } false {are } other{}} # new topics} + } remaining, or {CATEGORY, select, true {browse other topics in {catLink}} false {{latestLink}} other {}} " browse_all_categories: Browse all categories