FIX: Use default locale for flag reasons

This commit is contained in:
Gerhard Schlager 2019-07-12 12:04:16 +02:00
parent c4d1833588
commit 7311eeed39
2 changed files with 12 additions and 2 deletions

View File

@ -1020,7 +1020,12 @@ class User < ActiveRecord::Base
.where.not(post_id: disagreed_flag_post_ids) .where.not(post_id: disagreed_flag_post_ids)
.each do |tl| .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) results << PostActionCreator.create(Discourse.system_user, tl.post, :spam, message: message)
end end

View File

@ -34,7 +34,12 @@ class SpamRule::FlagSockpuppets
end end
def flag_sockpuppet_users 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) PostActionCreator.create(Discourse.system_user, @post, :spam, message: message)