mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 12:57:29 +08:00
FIX: Simplify post and topic deletion language (#13128)
Based on feedback from Matt Haughey, we don't need to use so many words when describing a deleted topic or post. Co-authored-by: Martin Brennan <martin@discourse.org>
This commit is contained in:
parent
fccf4d4375
commit
50926f6143
|
@ -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,
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user