From 49c3cf9c758a35a956570ccc5ffba78b2a2ede9b Mon Sep 17 00:00:00 2001 From: Saurabh Patel Date: Sat, 24 Nov 2018 16:55:23 +0530 Subject: [PATCH] UX: Topic stats were hard to translate --- .../discourse/models/category-list.js.es6 | 12 ++++++++---- config/locales/client.en.yml | 9 ++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/discourse/models/category-list.js.es6 b/app/assets/javascripts/discourse/models/category-list.js.es6 index 31aff951209..2b49a62b52e 100644 --- a/app/assets/javascripts/discourse/models/category-list.js.es6 +++ b/app/assets/javascripts/discourse/models/category-list.js.es6 @@ -52,10 +52,14 @@ CategoryList.reopenClass({ const unit = I18n.t(statPeriod); if (stat > 0) { c.stat = `${stat} / ${unit}`; - c.statTitle = I18n.t("categories.topic_stat_sentence", { - count: stat, - unit: unit - }); + + c.statTitle = I18n.t( + `categories.topic_stat_sentence_${statPeriod}`, + { + count: stat + } + ); + c[ "pick" + statPeriod[0].toUpperCase() + statPeriod.slice(1) ] = true; diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 3b7ec233ddd..b06270555dc 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -582,9 +582,12 @@ en: topic_sentence: one: "1 topic" other: "%{count} topics" - topic_stat_sentence: - one: "%{count} new topic in the past %{unit}." - other: "%{count} new topics in the past %{unit}." + topic_stat_sentence_week: + one: "%{count} new topic in the past week." + other: "%{count} new topics in the past week." + topic_stat_sentence_month: + one: "%{count} new topic in the past month." + other: "%{count} new topics in the past month." n_more: "Categories (%{count} more) ..." ip_lookup: