diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 816fb0672af..88260a1b8f0 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -363,7 +363,7 @@ en: reviving_old_topic: | ### Revive this topic? - The last reply to this topic was **%{days}** days ago. Your reply will bump the topic to the top of its list and notify anyone previously involved in the conversation. + The last reply to this topic was **%{time_ago}**. Your reply will bump the topic to the top of its list and notify anyone previously involved in the conversation. Are you sure you want to continue this old conversation? diff --git a/lib/composer_messages_finder.rb b/lib/composer_messages_finder.rb index 94d5a23efa7..8b765c0e142 100644 --- a/lib/composer_messages_finder.rb +++ b/lib/composer_messages_finder.rb @@ -187,7 +187,7 @@ class ComposerMessagesFinder templateName: 'education', wait_for_typing: false, extraClass: 'education-message', - body: PrettyText.cook(I18n.t('education.reviving_old_topic', days: (Time.zone.now - @topic.last_posted_at).round / 1.day)) + body: PrettyText.cook(I18n.t('education.reviving_old_topic', time_ago: FreedomPatches::Rails4.time_ago_in_words(@topic.last_posted_at, false, scope: :'datetime.distance_in_words_verbose'))) } end diff --git a/spec/components/composer_messages_finder_spec.rb b/spec/components/composer_messages_finder_spec.rb index fc5b04d0d28..3425162702c 100644 --- a/spec/components/composer_messages_finder_spec.rb +++ b/spec/components/composer_messages_finder_spec.rb @@ -442,7 +442,9 @@ describe ComposerMessagesFinder do it "notifies if last post is old" do topic = Fabricate(:topic, last_posted_at: 181.days.ago) - expect(described_class.new(user, composer_action: 'reply', topic_id: topic.id).check_reviving_old_topic).not_to be_blank + message = described_class.new(user, composer_action: 'reply', topic_id: topic.id).check_reviving_old_topic + expect(message).not_to be_blank + expect(message[:body]).to match(/6 months ago/) end end