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();
|
var newTopics = tracking.countNew();
|
||||||
|
|
||||||
if (newTopics + unreadTopics > 0) {
|
if (newTopics + unreadTopics > 0) {
|
||||||
if(category) {
|
var hasBoth = unreadTopics > 0 && newTopics > 0;
|
||||||
return I18n.messageFormat("topic.read_more_in_category_MF", {"UNREAD": unreadTopics, "NEW": newTopics, catLink: opts.catLink})
|
|
||||||
} else {
|
return I18n.messageFormat("topic.read_more_MF", {
|
||||||
return I18n.messageFormat("topic.read_more_MF", {"UNREAD": unreadTopics, "NEW": newTopics, latestLink: opts.latestLink})
|
"BOTH": hasBoth,
|
||||||
}
|
"UNREAD": unreadTopics,
|
||||||
|
"NEW": newTopics,
|
||||||
|
"CATEGORY": category ? true : false,
|
||||||
|
latestLink: opts.latestLink,
|
||||||
|
catLink: opts.catLink
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else if (category) {
|
else if (category) {
|
||||||
return Ember.String.i18n("topic.read_more_in_category", opts);
|
return Ember.String.i18n("topic.read_more_in_category", opts);
|
||||||
|
|
|
@ -543,8 +543,20 @@ en:
|
||||||
read_more: "Want to read more? {{catLink}} or {{latestLink}}."
|
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
|
# 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 {
|
||||||
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}"
|
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
|
browse_all_categories: Browse all categories
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue