A platform for community discussion. Free, open, simple.
FIX: Simplify post and topic deletion language (#13128)
Jeff Atwood50926f614342
diff --git a/app/assets/javascripts/discourse/app/models/post.js b/app/assets/javascripts/discourse/app/models/post.jsindex 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.ymlindex 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 <b>%{count}</b> post.other: "You have selected <b>%{count}</b> 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.rbindex 21d7973986b..750fa55a6e5 100644--- a/lib/post_destroyer.rb+++ b/lib/post_destroyer.rb@@ -196,9 +196,9 @@ class PostDestroyerI18n.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.rbindex 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 dopost = 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_stubsdiff --git a/spec/components/post_destroyer_spec.rb b/spec/components/post_destroyer_spec.rbindex f4500c78e3b..18297c020b1 100644--- a/spec/components/post_destroyer_spec.rb+++ b/spec/components/post_destroyer_spec.rb@@ -381,7 +381,7 @@ describe PostDestroyer doexpect(post2.deleted_at).to be_blankexpect(post2.deleted_by).to be_blankexpect(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 doexpect(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'))endcontext "as a moderator" do