From b0d1d7a3e859c31b90b9714f4648d9fef54c9d13 Mon Sep 17 00:00:00 2001 From: Vikhyat Korrapati Date: Sun, 9 Mar 2014 16:31:44 +0530 Subject: [PATCH] i18n of new/unread text next to topics. --- .../components/basic-topic-list.js.handlebars | 6 +++--- .../templates/discovery/categories.js.handlebars | 12 ++++++------ .../templates/list/topic_list_item.js.handlebars | 6 +++--- .../templates/site_map/_category.js.handlebars | 2 +- test/javascripts/templates/site_map_test.js | 1 - 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars b/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars index 2158f0f29be..45e45f3b4a5 100644 --- a/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars @@ -30,13 +30,13 @@ {{topicStatus topic=topic}} {{{unbound topic.fancy_title}}} {{#if unread}} - {{unbound topic.unread}} Unread + {{unbound topic.unread}} {{i18n filters.unread.title.zero}} {{/if}} {{#if topic.new_posts}} - {{unbound topic.new_posts}} New + {{unbound topic.new_posts}} {{i18n filters.new.title.zero}} {{/if}} {{#if topic.unseen}} - New + {{i18n filters.new.title.zero}} {{/if}} diff --git a/app/assets/javascripts/discourse/templates/discovery/categories.js.handlebars b/app/assets/javascripts/discourse/templates/discovery/categories.js.handlebars index a05f3e98271..9bb46d4f14d 100644 --- a/app/assets/javascripts/discourse/templates/discovery/categories.js.handlebars +++ b/app/assets/javascripts/discourse/templates/discovery/categories.js.handlebars @@ -20,10 +20,10 @@ {{#if controller.ordering}}{{/if}} {{categoryLink this allowUncategorized=true}} {{#if unreadTopics}} - {{unbound unreadTopics}} Unread + {{unbound unreadTopics}} {{i18n filters.unread.title.zero}} {{/if}} {{#if newTopics}} - {{unbound newTopics}} New + {{unbound newTopics}} {{i18n filters.new.title.zero}} {{/if}} @@ -59,13 +59,13 @@ {{topicStatus topic=this}} {{{unbound fancy_title}}} {{#if unread}} - {{unread}} Unread + {{unread}} {{i18n filters.unread.title.zero}} {{/if}} {{#if new_posts}} - {{new_posts}} New + {{new_posts}} {{i18n filters.new.title.zero}} {{/if}} {{#if unseen}} - New + {{i18n filters.new.title.zero}} {{/if}} {{#if controller.latestTopicOnly}} diff --git a/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars b/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars index 2d1a6ef16e9..79142de8ae3 100644 --- a/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars +++ b/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars @@ -14,13 +14,13 @@ {{topicStatus topic=this}} {{{topicLink this}}} {{#if unread}} - {{unread}} Unread + {{unread}} {{i18n filters.unread.title.zero}} {{/if}} {{#if displayNewPosts}} - {{displayNewPosts}} New + {{displayNewPosts}} {{i18n filters.new.title.zero}} {{/if}} {{#if unseen}} - New + {{i18n filters.new.title.zero}} {{/if}} {{#if hasExcerpt}} diff --git a/app/assets/javascripts/discourse/templates/site_map/_category.js.handlebars b/app/assets/javascripts/discourse/templates/site_map/_category.js.handlebars index f17cc4dd1d5..2f8d6856580 100644 --- a/app/assets/javascripts/discourse/templates/site_map/_category.js.handlebars +++ b/app/assets/javascripts/discourse/templates/site_map/_category.js.handlebars @@ -4,7 +4,7 @@ {{unreadTopics}} {{/if}} {{#if newTopics}} - {{newTopics}} New + {{newTopics}} {{i18n filters.new.title.zero}} {{/if}} {{else}} {{unbound topic_count}} diff --git a/test/javascripts/templates/site_map_test.js b/test/javascripts/templates/site_map_test.js index cb74e05da5f..8ff02b0b183 100644 --- a/test/javascripts/templates/site_map_test.js +++ b/test/javascripts/templates/site_map_test.js @@ -199,7 +199,6 @@ test("category links part is rendered correctly", function() { ok($firstCategoryNewTopicsLink.hasClass("badge") && $firstCategoryNewTopicsLink.hasClass("badge-notification"), "the new topics link has correct classes"); equal($firstCategoryNewTopicsLink.attr("title"), "topic.new_topics 20", "the new topics link has correct title"); notEqual($firstCategoryNewTopicsLink.text().indexOf("20"), -1, "the new topics link contains correct text"); - ok(exists($firstCategoryNewTopicsLink.find(".fa-asterisk")), "the new topics link contains correct icon"); var $firstCategoryAllTopicsCount = $categories.first().find(".topics-count"); ok(!exists($firstCategoryAllTopicsCount), "the count of all topics is not shown");