mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 10:50:26 -06:00
message format is awesome, remove 0 unread and 0 new links.
This commit is contained in:
parent
e52e46a609
commit
93be638d93
@ -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);
|
||||
|
@ -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 <a href='/unread'>1 unread</a>} other {are <a href='/unread'># unread</a>}} and {NEW, plural, one {<a href='/new'>1 new</a> topic} other {<a href='/new'># new</a> topics}} remaining, or browse other topics in {catLink}"
|
||||
read_more_MF: "There {UNREAD, plural, one {is <a href='/unread'>1 unread</a>} other {are <a href='/unread'># unread</a>}} and {NEW, plural, one {<a href='/new'>1 new</a> topic} other {<a href='/new'># new</a> topics}} remaining, or {latestLink}"
|
||||
read_more_MF: "There {
|
||||
UNREAD, plural,
|
||||
=0 {}
|
||||
one {
|
||||
is <a href='/unread'>1 unread</a>
|
||||
} other {
|
||||
are <a href='/unread'># unread</a>
|
||||
}
|
||||
} {
|
||||
NEW, plural,
|
||||
=0 {}
|
||||
one { {BOTH, select, true{and } false {is } other{}} <a href='/new'>1 new</a> topic}
|
||||
other { {BOTH, select, true{and } false {are } other{}} <a href='/new'># new</a> topics}
|
||||
} remaining, or {CATEGORY, select, true {browse other topics in {catLink}} false {{latestLink}} other {}} "
|
||||
|
||||
browse_all_categories: Browse all categories
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user