优先级/严重性 : normal
平台 : all
描述 : temporarily_closed_due_to_flags 通知未在服务器的 locale 中创建。
重现步骤 :
创建一个主题,然后
让许多用户(locale 设置与服务器的 locale 不同)标记该主题的帖子。然后
由 @system 创建的 temporarily_closed_due_to_flags 通知(en_US locale 中的“This topic is temporarily closed for at least %{count} hour due to a large number of community flags.”)将显示为用户的 locale 而不是服务器的 locale。
这与此提交修复的问题类似。
committed 02:40PM - 17 Aug 20 UTC
Previously it was created with the locale of the user who created the final post… in the topic
我相信可以通过更改以下代码来修复:
# the threshold has been reached, we will close the topic waiting for intervention
topic.update_status(
"closed",
true,
Discourse.system_user,
message:
I18n.t("temporarily_closed_due_to_flags", count: SiteSetting.num_hours_to_close_topic),
)
1 个赞
sam
(Sam Saffron)
2025 年8 月 31 日 23:38
2
是的,这是一个很好的发现,它可能是在最后一个标志的上下文中运行,而不是在服务器的本地化上下文中运行。
一个简单的:
locale: SiteSetting.default_locale 将解决这个问题。
我们将在未来几周内解决这个问题。