diff --git a/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars b/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars index bfe9f23839d..1d537086da8 100644 --- a/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars @@ -60,7 +60,7 @@ <ul class='topic-links'> {{#groupedEach infoLinks}} <li> - <span class='badge badge-notification clicks' title='{{i18n topic_map.clicks}}'>{{clicks}}</span> + <span class='badge badge-notification clicks' title='{{i18n topic_map.clicks count=clicks}}'>{{clicks}}</span> <a href="{{unbound url}}" target="_blank" class='topic-link track-link' data-user-id="{{unbound user_id}}" data-ignore-post-id="true" title="{{unbound url}}"> {{#if title}}{{title}}{{else}}{{shortenUrl url}}{{/if}} {{#unless internal}}<i class='fa fa-external-link'></i>{{/unless}} diff --git a/app/assets/javascripts/discourse/views/post_view.js b/app/assets/javascripts/discourse/views/post_view.js index 4db634c57ed..1f98d4783f7 100644 --- a/app/assets/javascripts/discourse/views/post_view.js +++ b/app/assets/javascripts/discourse/views/post_view.js @@ -134,7 +134,7 @@ Discourse.PostView = Discourse.GroupedView.extend(Ember.Evented, { // don't display badge counts on category badge if (link.closest('.badge-category').length === 0 && (link.closest(".onebox-result").length === 0 || link.hasClass("track-link"))) { link.append("<span class='badge badge-notification clicks' title='" + - I18n.t("topic_map.clicks") + + I18n.t("topic_map.clicks", {count: lc.clicks}) + "'>" + Discourse.Formatter.number(lc.clicks) + "</span>"); } } diff --git a/app/serializers/topic_link_serializer.rb b/app/serializers/topic_link_serializer.rb index ab303a815f4..f73972a4138 100644 --- a/app/serializers/topic_link_serializer.rb +++ b/app/serializers/topic_link_serializer.rb @@ -29,7 +29,7 @@ class TopicLinkSerializer < ApplicationSerializer end def clicks - object['clicks'] || 0 + object['clicks'].to_i end def user_id diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index cda23859b19..50a4bf6a0bc 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1121,7 +1121,9 @@ en: topic_map: title: "Topic Summary" links_shown: "show all {{totalLinks}} links..." - clicks: "clicks" + clicks: + one: "1 click" + other: "%{count} clicks" topic_statuses: locked: