# 更改区域设置后未显示翻译，但 HTML 语言已更改

**URL:** https://meta.discourse.org/t/translation-not-displayed-on-locale-change-but-html-language-changes-nonetheless/380395
**Category:** Support
**Tags:** content-localization
**Created:** [2025年八月26日 16:14 UTC](https://meta.discourse.org/t/translation-not-displayed-on-locale-change-but-html-language-changes-nonetheless/380395 "2025-08-26T16:14:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![monty25](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@monty25](https://meta.discourse.org/u/monty25)
#### Post date: [2025年八月26日 16:14 UTC](https://meta.discourse.org/t/translation-not-displayed-on-locale-change-but-html-language-changes-nonetheless/380395/1 "2025-08-26T16:14:14Z")

</div>

我们在 Discourse 3.5 上设置了内容本地化：

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/2/f/62f0102abe2fa79b5f9b72777818031df54f79fe.png)

一个主题已从默认语言荷兰语翻译成英语（英国），如红色 3 所示：

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

使用隐私浏览器窗口时，会出现语言选择器，但更改它并不会实际更改文本：

当添加 `tl` 参数并设置为 `en` 或 `en_gb` 时，也会出现相同的输出。

此外，没有 `hreflang` 链接（但这似乎是一个已知的特性差距）。

但是，当更改语言时，HTML 的第一行会从荷兰语更改为：

```html
<html lang="nl" class="desktop-view not-mobile-device text-size-normal anon">

```

对于英语（英国）更改为以下内容：

```html
<html lang="en-GB" class="desktop-view not-mobile-device text-size-normal anon">

```

可能是什么原因导致未显示翻译的文本？

---

<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年八月30日 04:54 UTC](https://meta.discourse.org/t/translation-not-displayed-on-locale-change-but-html-language-changes-nonetheless/380395/2 "2025-08-30T04:54:15Z")

</div>

> [@monty25](#):
>
> 翻译的文本未显示，可能是什么原因？

您能否点击帖子的常规编辑按钮，并检查帖子的原始语言是否正确？

 ![Screenshot 2025-08-30 at 12.48.04 PM](https://global.discourse-cdn.com/meta/original/4X/5/c/0/5c07d40c90637402284cb088ffe0e48abbc3eaad.png)

* * *

> [@monty25](#):
>
> 没有 `hreflang` 链接

我们有一个新的实验性功能，它隐藏在 [隐藏的站点设置](https://meta.discourse.org/t/hidden-site-settings-reference-guide/308774) 中——`content_localization_crawler_param`，它可以为 Google 提供翻译内容。

我们仍处于测试阶段，但到目前为止，我已经看到了一些理想的结果。

 ![performance](https://global.discourse-cdn.com/meta/original/4X/4/7/b/47b72a20071350035fd2a359b43e88135f11c233.png) ![indexed pages](https://global.discourse-cdn.com/meta/original/4X/f/1/8/f18d64e60c136308184d482c65b08f507d7b18b6.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: [2025年八月30日 05:55 UTC](https://meta.discourse.org/t/translation-not-displayed-on-locale-change-but-html-language-changes-nonetheless/380395/3 "2025-08-30T05:55:58Z")

</div>

> [@monty25](#):
>
> Discourse 3.5

所以您使用的是稳定版分支？恐怕 Nat 提到的新设置在稳定版中还不可用。

---

<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: [2025年九月22日 21:47 UTC](https://meta.discourse.org/t/translation-not-displayed-on-locale-change-but-html-language-changes-nonetheless/380395/4 "2025-09-22T21:47:18Z")

</div>

@monty25 您的问题解决了吗？正如 Moin 指出的那样，翻译工作相当前沿，如果您想使用它，您应该使用最新版本，而不是稳定版本。

---

<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: [2025年十月6日 21:48 UTC](https://meta.discourse.org/t/translation-not-displayed-on-locale-change-but-html-language-changes-nonetheless/380395/5 "2025-10-06T21:48:09Z")

</div>

此主题在上次回复后 14 天自动关闭。不再允许回复。
