Skip to content

A platform for community discussion. Free, open, simple.

FIX: Use default locale for flag reasons

Gerhard Schlager7311eeed39e8
diff --git a/app/models/user.rb b/app/models/user.rb
index 3e42b504bbe..bfcd5650410 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1020,7 +1020,12 @@ class User < ActiveRecord::Base
.where.not(post_id: disagreed_flag_post_ids)
.each do |tl|
- message = I18n.t('flag_reason.spam_hosts', domain: tl.domain, base_path: Discourse.base_path)
+ message = I18n.t(
+ 'flag_reason.spam_hosts',
+ domain: tl.domain,
+ base_path: Discourse.base_path,
+ locale: SiteSetting.default_locale
+ )
results << PostActionCreator.create(Discourse.system_user, tl.post, :spam, message: message)
end
diff --git a/app/services/spam_rule/flag_sockpuppets.rb b/app/services/spam_rule/flag_sockpuppets.rb
index c67636904c6..26c53ff1203 100644
--- a/app/services/spam_rule/flag_sockpuppets.rb
+++ b/app/services/spam_rule/flag_sockpuppets.rb
@@ -34,7 +34,12 @@ class SpamRule::FlagSockpuppets
end
def flag_sockpuppet_users
- message = I18n.t('flag_reason.sockpuppet', ip_address: @post.user.ip_address, base_path: Discourse.base_path)
+ message = I18n.t(
+ 'flag_reason.sockpuppet',
+ ip_address: @post.user.ip_address,
+ base_path: Discourse.base_path,
+ locale: SiteSetting.default_locale
+ )
PostActionCreator.create(Discourse.system_user, @post, :spam, message: message)