# Discourse AI 错误？

**URL:** <https://meta.discourse.org/t/discourse-ai-translations-bug/384214>\
**Category:** Support\
**Tags:** ai, dynaloc\
**Created:** [2025年九月28日 12:13 UTC](https://meta.discourse.org/t/discourse-ai-translations-bug/384214 "2025-09-28T12:13:14Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![昊毅\_周](https://avatars.discourse-cdn.com/v4/letter/%E6%98%8A/48db29/32.png) [@昊毅\_周](https://meta.discourse.org/u/%E6%98%8A%E6%AF%85_%E5%91%A8)\
**Post date:** [2025年九月28日 12:13 UTC](https://meta.discourse.org/t/discourse-ai-translations-bug/384214/1 "2025-09-28T12:13:14Z")

</div>

我在使用 Discourse AI 时遇到了一些错误。情况如下：  
首先，让我们看一个正确的帖子，以证明我的配置不是问题，一切都按我预期的那样工作。  
我的网站的基础语言是简体中文，还有 9 种其他可用语言。  
这个“New post test 0 translation”帖子是正常的。

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/9/e/59e4f00961d828ece58428e8ceb32b31c3f45cc2.jpeg)

但是，一些单独的帖子出现了问题。例如：  
这个“About ‘Image Library’ category”帖子。原始帖子是用简体中文发布的（在创建类别时自动发布的）。  
但在翻译结果中，原始的简体中文被再次翻译成“zh\_CN”，而不是翻译成英文。

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/3/c/e3c641e77f51a02fb7e3eaedcb0f477bb1f2a0d9.jpeg)

当我尝试使用红色地球图标手动添加英文翻译时，出现了一些奇怪的现象。

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/7/a/f7a79593e100745111b1c36284598645007e43ba.jpeg)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/a/6/7/a67bb56f332a70808f132bae7fca860042cee009.png)

在下拉列表中，我无法为英文添加单独的翻译。  
但是，在我的全局设置中，英文（美国）已经正确添加。

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/f/a/dfa60d75685f0e05716e244d5d95809fc61cee67.jpeg)

我已经禁用了 CDN 缓存，并反复清除了本地浏览器缓存。  
这排除了缓存是问题所在。  
我的基本配置也可以排除，因为第一张图片显示了正确的行为。  
我不明白为什么会出现这个问题。我该如何解决？  
我的 Discourse 版本是 3.6.0.beta1-dev(b8e86ceb23)  
服务器操作系统是 Debian 12.12  
我已在本地使用最新版本的 Chrome 和 Opera 浏览器进行了测试。  
正确情况的 URL：[https://openttc.com/t/topic/61](https://www.google.com/url?sa=E&q=https%3A%2F%2Fopenttc.com%2Ft%2Ftopic%2F61)  
错误情况的 URL：[https://openttc.com/t/topic/58](https://www.google.com/url?sa=E&q=https%3A%2F%2Fopenttc.com%2Ft%2Ftopic%2F58)

---

<div class="post-metadata">

**Author:** ![昊毅\_周](https://avatars.discourse-cdn.com/v4/letter/%E6%98%8A/48db29/32.png) [@昊毅\_周](https://meta.discourse.org/u/%E6%98%8A%E6%AF%85_%E5%91%A8)\
**Post date:** [2025年九月29日 12:05 UTC](https://meta.discourse.org/t/discourse-ai-translations-bug/384214/3 "2025-09-29T12:05:11Z")

</div>

这不是个BUG。因为所有分类的说明（系统创建）的默认语言就是En。无论你输入了什么，默认就是En帖。所以不会触发翻译。

---

<div class="post-metadata">

**Author:** ![nat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nat/32/235063_2.png) [@nat](https://meta.discourse.org/u/nat)\
**Post date:** [2025年九月29日 12:19 UTC](https://meta.discourse.org/t/discourse-ai-translations-bug/384214/4 "2025-09-29T12:19:16Z")

</div>

每个帖子都由人工智能检测语言。

如果您有一篇最初用“中文”撰写的帖子，那么它应该被检测为“zh\_CN”。您可以在常规编辑器（非翻译编辑器）中查看检测到的语言，就在 🌐 旁边。

 ![example of EN at the top of the post](https://global.discourse-cdn.com/meta/original/4X/2/2/d/22df5c15a4426d0a4930dd0258648c20ecfacb17.png)

检测到的语言很重要，这样翻译器就不会不必要地将其翻译成它自己检测到的语言，而是将帖子翻译成所有其他语言。

我怀疑 [關於“圖像庫”類別 - 图像库 - OpenTTC](https://openttc.com/t/topic/58) 存在的问题是检测到的语言不正确，您能检查一下吗？

---

<div class="post-metadata">

**Author:** ![昊毅\_周](https://avatars.discourse-cdn.com/v4/letter/%E6%98%8A/48db29/32.png) [@昊毅\_周](https://meta.discourse.org/u/%E6%98%8A%E6%AF%85_%E5%91%A8)\
**Post date:** [2025年九月29日 13:25 UTC](https://meta.discourse.org/t/discourse-ai-translations-bug/384214/5 "2025-09-29T13:25:04Z")

</div>

是的。它被错误地检测为en了，而不是zh\_CN。我检查了一下，发现所有的由系统创建的分类说明帖子，都被检测为en了。即便是使用中文写的。

新的问题：FAQ页面支持多语言吗？应该在哪里添加翻译？

---

<div class="post-metadata">

**Author:** ![nat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nat/32/235063_2.png) [@nat](https://meta.discourse.org/u/nat)\
**Post date:** [2025年九月29日 13:31 UTC](https://meta.discourse.org/t/discourse-ai-translations-bug/384214/6 "2025-09-29T13:31:57Z")

</div>

> [@昊毅\_周](#):
>
> FAQ页面是否支持多语言？

我相信 FAQ 页面使用了典型的 I18n 键。您可以前往您的网站管理页面进行站点文本的替换，例如：[https://openttc.com/admin/customize/site\_texts?q=guidelines\_topic.body](https://openttc.com/admin/customize/site_texts?q=guidelines_topic.body)。

---

<div class="post-metadata">

**Author:** ![昊毅\_周](https://avatars.discourse-cdn.com/v4/letter/%E6%98%8A/48db29/32.png) [@昊毅\_周](https://meta.discourse.org/u/%E6%98%8A%E6%AF%85_%E5%91%A8)\
**Post date:** [2025年九月29日 13:35 UTC](https://meta.discourse.org/t/discourse-ai-translations-bug/384214/7 "2025-09-29T13:35:35Z")

</div>

好的，非常感谢您的帮助。

> [@昊毅\_周](#):
>
> 我检查了一下，发现所有的由系统创建的分类说明帖子，都被检测为en了。即便是使用中文写的。

我想这是一个确实存在的问题。不知道这种情况普遍存在还是因为我的配置错误。

---

<div class="post-metadata">

**Author:** ![nat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nat/32/235063_2.png) [@nat](https://meta.discourse.org/u/nat)\
**Post date:** [2025年九月29日 13:37 UTC](https://meta.discourse.org/t/discourse-ai-translations-bug/384214/8 "2025-09-29T13:37:40Z")

</div>

这也可能与时间有关。如果类别是在站点语言切换之前创建的，那么类别主题的语言可能都是英语。

在这种情况下，您可以转到主题的第一个帖子，打开撰写器，然后将它们切换为中文。

---

<div class="post-metadata">

**Author:** ![昊毅\_周](https://avatars.discourse-cdn.com/v4/letter/%E6%98%8A/48db29/32.png) [@昊毅\_周](https://meta.discourse.org/u/%E6%98%8A%E6%AF%85_%E5%91%A8)\
**Post date:** [2025年九月29日 13:48 UTC](https://meta.discourse.org/t/discourse-ai-translations-bug/384214/9 "2025-09-29T13:48:36Z")

</div>

你好。经过我的尝试。  
我在6分钟前创建了一个新分类：[https://openttc.com/t/topic/66](https://openttc.com/t/topic/66)  
然后我什么都没有做。等待翻译生效。  
随后我就得到了一个内容是中文，但被识别成en的帖子。

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/6/9/d69f080986c634a77c0f673873d152dc5fc70826.png)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/9/8/6/986e3b1ba57f8401cc02af1dfccf199b4da6e30e.png)  
在这个分类被创建时，我的站点语言100%是简体中文。  
我的AI模型用的是Openrouter的Llama3.1 8b。

---

<div class="post-metadata">

**Author:** ![nat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nat/32/235063_2.png) [@nat](https://meta.discourse.org/u/nat)\
**Post date:** [2025年九月29日 14:13 UTC](https://meta.discourse.org/t/discourse-ai-translations-bug/384214/10 "2025-09-29T14:13:01Z")

</div>

有意思，你能运行这个数据浏览器查询吗？

```plaintext
-- [params]
-- integer :topic_id = 66

SELECT 
  a.id,
  a.created_at,
  a.response_tokens,
  (REGEXP_MATCH(a.raw_response_payload, '"text": "([^"\\]+)"'))[1] AS llm_detected_locale,
  a.raw_response_payload
FROM ai_api_audit_logs a
JOIN posts p ON p.id = a.post_id AND p.deleted_at IS NULL
LEFT JOIN topics t ON t.id = a.topic_id AND t.deleted_at IS NULL
WHERE t.id = :topic_id
AND p.post_number = 1
AND a.feature_name = 'translation'
AND a.response_tokens < 5

```

这将告诉我们 LLM 实际返回的是什么。

---

<div class="post-metadata">

**Author:** ![昊毅\_周](https://avatars.discourse-cdn.com/v4/letter/%E6%98%8A/48db29/32.png) [@昊毅\_周](https://meta.discourse.org/u/%E6%98%8A%E6%AF%85_%E5%91%A8)\
**Post date:** [2025年十月16日 12:41 UTC](https://meta.discourse.org/t/discourse-ai-translations-bug/384214/11 "2025-10-16T12:41:45Z")

</div>

您好。我最终没有解决这个问题，但是影响不大。  
最准确的问题描述应该是：当我创建一个新的分类时，那张由系统自动生成的“关于此分类”的帖子，他的默认语言会被识别成en。虽然他的文本内容确实是简体中文，但当我打开帖子时，他就是会被识别成英文，需要我手动更改才行。  
我不确定，这是不是和我的app.yml文件设置有关？

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2026年七月15日 15:03 UTC](https://meta.discourse.org/t/discourse-ai-translations-bug/384214/12 "2026-07-15T15:03:10Z")

</div>


