優先度/重大度 : normal
プラットフォーム : all
説明 : temporarily_closed_due_to_flags 通知がサーバーのロケールで作成されません。
再現手順 :
トピックを作成し、
多くのユーザー(サーバーのロケールとは異なるロケール設定を持つ)にトピックの投稿をフラグ付けさせます。すると、
@system によって作成される temporarily_closed_due_to_flags 通知(en_US ロケールでの「This topic is temporarily closed for at least %{count} hour due to a large number of community flags.」)が、サーバーのロケールではなく、ユーザーのロケールで表示されます。
これは、このコミットで修正されたものと同様です。
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 日午後 11:38
2
はい、それは良い指摘です。おそらく、サーバーのローカライゼーションコンテキストではなく、最後のフラッガーのコンテキストで実行されているのでしょう。
簡単な:
locale: SiteSetting.default_locale で解決できます。
数週間以内に解決します。
このバグを報告していただきありがとうございます。このPRで修正されました
main ← default-locale-temporarily-close-flag
opened 06:53AM - 04 Sep 25 UTC
When a topic is automatically closed due to flags, the system message should alw… ays use the site's default locale rather than the current user's locale to ensure consistency for all users viewing the topic.
https://meta.discourse.org/t/temporarily-closed-due-to-flags-notice-not-in-servers-locale/381000/1
「いいね!」 2
このトピックは4日後に自動的に閉じられました。返信はもう許可されていません。