Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/post_action_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ def auto_close_if_threshold_reached
true,
Discourse.system_user,
message:
I18n.t("temporarily_closed_due_to_flags", count: SiteSetting.num_hours_to_close_topic),
I18n.t(
"temporarily_closed_due_to_flags",
count: SiteSetting.num_hours_to_close_topic,
locale: SiteSetting.default_locale,
),
)

topic.set_or_create_timer(
Expand Down
15 changes: 15 additions & 0 deletions spec/lib/post_action_creator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,21 @@
expect(score.reviewed_at).to be_blank
end

it "uses the system locale for the message when auto close" do
Topic.any_instance.stubs(:auto_close_threshold_reached?).returns(true)
I18n.with_locale(:fr) { PostActionCreator.create(user, post, :inappropriate) }

post.topic.reload

expect(post.topic.posts.last.raw).to eq(
I18n.t(
"temporarily_closed_due_to_flags",
count: SiteSetting.num_hours_to_close_topic,
locale: :en,
),
)
end

describe "Auto hide spam flagged posts" do
before do
user.trust_level = TrustLevel[3]
Expand Down
Loading