diff --git a/app/assets/javascripts/discourse/app/models/post.js b/app/assets/javascripts/discourse/app/models/post.js index 77e1967f2ed..610fa3dd43c 100644 --- a/app/assets/javascripts/discourse/app/models/post.js +++ b/app/assets/javascripts/discourse/app/models/post.js @@ -208,13 +208,9 @@ const Post = RestModel.extend({ } else { const key = this.post_number === 1 - ? "topic.deleted_by_author" - : "post.deleted_by_author"; - promise = cookAsync( - I18n.t(key, { - count: this.siteSettings.delete_removed_posts_after, - }) - ).then((cooked) => { + ? "topic.deleted_by_author_simple" + : "post.deleted_by_author_simple"; + promise = cookAsync(I18n.t(key)).then((cooked) => { this.setProperties({ cooked: cooked, can_delete: false, diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 5d6f24931d7..6f95604b872 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -2877,10 +2877,7 @@ en: description: one: You have selected %{count} post. other: "You have selected %{count} posts." - - deleted_by_author: - one: "(topic withdrawn by author, will be automatically deleted in %{count} hour unless flagged)" - other: "(topic withdrawn by author, will be automatically deleted in %{count} hours unless flagged)" + deleted_by_author_simple: "(topic deleted by author)" post: quote_reply: "Quote" @@ -2896,9 +2893,7 @@ en: follow_quote: "go to the quoted post" show_full: "Show Full Post" show_hidden: "View ignored content." - deleted_by_author: - one: "(post withdrawn by author, will be automatically deleted in %{count} hour unless flagged)" - other: "(post withdrawn by author, will be automatically deleted in %{count} hours unless flagged)" + deleted_by_author_simple: "(post deleted by author)" collapse: "collapse" expand_collapse: "expand/collapse" locked: "a staff member has locked this post from being edited" diff --git a/lib/post_destroyer.rb b/lib/post_destroyer.rb index 21d7973986b..750fa55a6e5 100644 --- a/lib/post_destroyer.rb +++ b/lib/post_destroyer.rb @@ -196,9 +196,9 @@ class PostDestroyer I18n.with_locale(SiteSetting.default_locale) do # don't call revise from within transaction, high risk of deadlock - key = @post.is_first_post? ? 'js.topic.deleted_by_author' : 'js.post.deleted_by_author' + key = @post.is_first_post? ? 'js.topic.deleted_by_author_simple' : 'js.post.deleted_by_author_simple' @post.revise(@user, - { raw: I18n.t(key, count: delete_removed_posts_after) }, + { raw: I18n.t(key) }, force_new_version: true, deleting_post: true ) diff --git a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/advanced_user_narrative_spec.rb b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/advanced_user_narrative_spec.rb index 70ee377e769..4774223b132 100644 --- a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/advanced_user_narrative_spec.rb +++ b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/advanced_user_narrative_spec.rb @@ -330,7 +330,7 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do post = Post.last - expect(post.raw).to eq(I18n.t('js.post.deleted_by_author', count: 1)) + expect(post.raw).to eq(I18n.t('js.post.deleted_by_author_simple')) PostDestroyer.destroy_stubs diff --git a/spec/components/post_destroyer_spec.rb b/spec/components/post_destroyer_spec.rb index f4500c78e3b..18297c020b1 100644 --- a/spec/components/post_destroyer_spec.rb +++ b/spec/components/post_destroyer_spec.rb @@ -381,7 +381,7 @@ describe PostDestroyer do expect(post2.deleted_at).to be_blank expect(post2.deleted_by).to be_blank expect(post2.user_deleted).to eq(true) - expect(post2.raw).to eq(I18n.t('js.topic.deleted_by_author', count: 24)) + expect(post2.raw).to eq(I18n.t('js.topic.deleted_by_author_simple')) expect(post2.version).to eq(2) expect(called).to eq(1) expect(user_stat.reload.post_count).to eq(0) @@ -462,7 +462,7 @@ describe PostDestroyer do expect(post.deleted_at).to eq(nil) expect(post.user_deleted).to eq(true) - expect(post.raw).to eq(I18n.t('js.post.deleted_by_author', count: 1)) + expect(post.raw).to eq(I18n.t('js.post.deleted_by_author_simple')) end context "as a moderator" do