# 修改/添加与自定义审核标志相关联的网站文字吗？

**URL:** https://meta.discourse.org/t/modify-add-site-text-associated-with-custom-moderation-flags/335942
**Category:** Bug
**Tags:** review-queue
**Created:** [2024年十一月13日 13:13 UTC](https://meta.discourse.org/t/modify-add-site-text-associated-with-custom-moderation-flags/335942 "2024-11-13T13:13:10Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![scharnkn](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@scharnkn](https://meta.discourse.org/u/scharnkn)
#### Post date: [2024年十一月13日 13:13 UTC](https://meta.discourse.org/t/modify-add-site-text-associated-with-custom-moderation-flags/335942/1 "2024-11-13T13:13:11Z")

</div>

您好，

我一直在试用新的“自定义审核标志”功能，并注意到在某些情况下创建新标志会导致丢失文本键错误。

例如，在使用“隐藏帖子”的审核选项时，发送给用户的消息期望存在一个文本键“flag\_reasons.mycustomflag”。

是否可以添加/定义丢失的键？据我所知，站点文本功能仅允许翻译已存在的键。

任何指导或提示都将不胜感激！

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2024年十二月1日 17:37 UTC](https://meta.discourse.org/t/modify-add-site-text-associated-with-custom-moderation-flags/335942/3 "2024-12-01T17:37:12Z")

</div>

我们目前正在为即将发布的新增字符串进行翻译。您在使用自定义标志的字符串时遇到了什么具体问题吗？根据您的问题，我不太清楚。您是否可以分享一张截图？您的论坛是什么语言？标志在美国英语中是否能正常工作？

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2024年十二月1日 17:59 UTC](https://meta.discourse.org/t/modify-add-site-text-associated-with-custom-moderation-flags/335942/4 "2024-12-01T17:59:34Z")

</div>

由美国英语论坛发送的电子邮件，自定义标志“its\_hostile”

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/f/4/5f492c8e2ed59c80402e03149a1c69f9fa21f122.png)

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2024年十二月1日 18:33 UTC](https://meta.discourse.org/t/modify-add-site-text-associated-with-custom-moderation-flags/335942/5 "2024-12-01T18:33:38Z")

</div>

我认为问题与特定翻译无关。

当帖子因社区标记而被隐藏时，会向作者发送一条私人消息。此消息包含一个原因。例如：

 ![Screenshot_20241201_193014_Gallery](https://global.discourse-cdn.com/meta/original/4X/b/0/8/b0891cf52e4fb231edf1d85aae05106e8476d865.jpeg)

创建消息时会使用这些原因。

> <https://github.com/discourse/discourse/blob/main/config/locales/server.en.yml#L3239-L3244>

添加此原因到消息的代码使用了 `post_action_type`

> <https://github.com/discourse/discourse/blob/efa2589204fadd731278e516ed0d6ed76c3e534b/app/models/post.rb#L651-L672>

这适用于默认的标记原因。例如，`flag_reasons.spam`，如上面的屏幕截图所示。  
问题在于没有为自定义标记原因提供这样的字符串。例如，如果您创建一个“测试”原因并启用 `Auto hide flagged content`。

然后会使用 `flag_reasons.custom_testing`。但是，这个原因不存在。语言无关紧要；它甚至不存在于英语中，因为它是一个自定义标记。

 ![Screenshot_20241201_192706_Gallery](https://global.discourse-cdn.com/meta/original/4X/7/7/d/77d6206233e37f33f4e9eed07a2a481c089a5383.jpeg)

并且当帖子被删除时（请参阅 RGJ 帖子中的屏幕截图）也会使用相同的原因

> <https://github.com/discourse/discourse/blob/efa2589204fadd731278e516ed0d6ed76c3e534b/lib/post_destroyer.rb#L407-L417>

顺便说一句，“responders”也缺少非法的理由

> <https://github.com/discourse/discourse/blob/main/config/locales/server.en.yml#L3245-L3249>

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2024年十二月2日 00:33 UTC](https://meta.discourse.org/t/modify-add-site-text-associated-with-custom-moderation-flags/335942/6 "2024-12-02T00:33:33Z")

</div>

> [@scharnkn](#):
>
> 在使用“隐藏帖子”的审核选项时，发送给用户的消息会期望存在一个名为“flag\_reasons.mycustomflag”的文本键。

感谢 @scharnkn 的报告，也感谢 @moin 的跟进！

还有其他地方出现了意外的文本键而不是预期的文本吗？

---

<div class="post-metadata">

### Author: ![scharnkn](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@scharnkn](https://meta.discourse.org/u/scharnkn)
#### Post date: [2024年十二月4日 11:40 UTC](https://meta.discourse.org/t/modify-add-site-text-associated-with-custom-moderation-flags/335942/8 "2024-12-04T11:40:03Z")

</div>

大家好，

感谢您提供有用的背景信息。对于我帖子中最初缺乏细节，我深表歉意。

> 文本键是否在其他地方意外显示，而不是预期的文本？

我没有在其他地方遇到过这个问题。

此致，  
Katrin

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2024年十二月4日 12:06 UTC](https://meta.discourse.org/t/modify-add-site-text-associated-with-custom-moderation-flags/335942/9 "2024-12-04T12:06:01Z")

</div>

我注意到 [FIX: update flag reason message with default value (#30026) · discourse/discourse@28b4ff6 · GitHub](https://github.com/discourse/discourse/commit/28b4ff6cb694d67af177287a8a249fd072701058)  
所以我又试了一下：

相比于“您的帖子被标记为 **跑题** ：社区认为它与当前由标题和第一帖定义的讨论主题不符”等，自定义标记的原因仅仅是一个关键词。  
也许“您的帖子被标记为 **原因** 。”也可以用于自定义标记。

 ![Screenshot_20241204_130001_Firefox](https://global.discourse-cdn.com/meta/original/4X/a/8/5/a85ef78e8963a4d35f739a6f66600d5d202d0543.jpeg)  
 ![Screenshot_20241204_130429_Firefox](https://global.discourse-cdn.com/meta/original/4X/e/a/c/eac1a9fcaa4155194aadcd083e341986472977a7.jpeg)

并且在给响应者看的版本中：“帖子被标记为 **原因** 。”

 ![Screenshot_20241204_130328_Firefox](https://global.discourse-cdn.com/meta/original/4X/a/e/0/ae0c50a31885527f2b2bd554a8904a5c219a8043.jpeg)  
（我也觉得为“非法”提供默认文本会很有帮助，因为这不是自定义原因。）

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2024年十二月4日 19:32 UTC](https://meta.discourse.org/t/modify-add-site-text-associated-with-custom-moderation-flags/335942/10 "2024-12-04T19:32:44Z")

</div>

我倾向于同意 Moin 的观点……

1. 对于非自定义标志的“非法”，请显示 `topic_flag_types.illegal.description` 的内容，该内容已存在。在美式英语中，它是“此主题需要工作人员关注，因为我认为它包含非法内容。”
2. 对于自定义标志，为清晰起见，将 **原因** 更改为“帖子被标记为 **原因** ”

是否有技术限制阻止我们在电子邮件中包含原因描述？

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2024年十二月4日 19:36 UTC](https://meta.discourse.org/t/modify-add-site-text-associated-with-custom-moderation-flags/335942/11 "2024-12-04T19:36:01Z")

</div>

> [@tobiaseigen](#):
>
> which exists

它不存在。嗯，描述确实存在，但这与原因不同。有 3 种文本：

1. 向标记帖子的用户显示的描述。

2. 向帖子作者显示的理由：

3. 当其帖子也被删除且设置已启用时，向已删除帖子的回复者显示的理由。这个“非法”的理由缺失了：

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2024年十二月4日 20:17 UTC](https://meta.discourse.org/t/modify-add-site-text-associated-with-custom-moderation-flags/335942/12 "2024-12-04T20:17:46Z")

</div>

哦，有意思。(2)和(3)几乎一模一样——我想知道我们是否因为这两种情况的文本不同而过于复杂化了。

目前，我们似乎可以为“非法”创建一个新字符串并确保它能正常工作，例如：

```plaintext
responder:
   illegal: "该帖子被标记为 **非法** ：社区认为它可能违法。"

```

我们也可以在(2)和(3)中创建一个新的字符串来涵盖所有自定义标记，例如：

```plaintext
flag_reasons:
   custom: "您的帖子被标记为 **reason** 。"

```

```plaintext
responder:
   custom: "该帖子被标记为 **reason** 。"

```
