# 允许管理员选择为已登录用户显示页眉语言切换器

**URL:** https://meta.discourse.org/t/allow-admins-the-option-to-show-the-header-language-switcher-even-for-logged-in-users/378686
**Category:** Feature
**Tags:** dynaloc, content-localization
**Created:** [2025 年8 月 15 日 03:04 UTC](https://meta.discourse.org/t/allow-admins-the-option-to-show-the-header-language-switcher-even-for-logged-in-users/378686 "2025-08-15T03:04:34Z")
**Posts on this page:** 1
**Showing post:** 1

<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 年8 月 15 日 03:04 UTC](https://meta.discourse.org/t/allow-admins-the-option-to-show-the-header-language-switcher-even-for-logged-in-users/378686/1 "2025-08-15T03:04:34Z")

</div>

当前，站点设置 `content localization anon language switcher` 是一个仅为未登录用户显示语言切换器的开关。

> **截图 📸**
>
> ### 设置
> 
> ![setting](https://global.discourse-cdn.com/meta/original/4X/8/0/7/807b66ca80537bf2d4f92e9cbfb2efa248fc4328.png)
> 
> ### 切换器
> 
> ![Screenshot 2025-08-15 at 10.54.29 AM](https://global.discourse-cdn.com/meta/original/4X/6/2/2/622eeb3ddbfda1eaa4708ed00c8b2d74ce351a84.jpeg)

有一些请求希望将此功能扩展到允许登录用户从标题中设置语言。

这里的工作将包括：

- 更新设置名称，排除“anon”
- 将设置扩展为“none”、“anonymous”、“all”

 ![Screenshot 2025-08-15 at 10.57.01 AM](https://global.discourse-cdn.com/meta/original/4X/7/1/6/7166e2ebd90db37962626cbb0410a92ea31d10fd.png)

- 匿名语言通过 cookie 进行跟踪，在登录用户中切换语言应更新 `user.locale` 而不是 cookie。

完成此操作后，我们还应更新相关主题（例如 [https://meta.discourse.org/t/header-locale-selector/240697），表明现在核心功能已支持此功能。](https://meta.discourse.org/t/header-locale-selector/240697%EF%BC%89%EF%BC%8C%E8%A1%A8%E6%98%8E%E7%8E%B0%E5%9C%A8%E6%A0%B8%E5%BF%83%E5%8A%9F%E8%83%BD%E5%B7%B2%E6%94%AF%E6%8C%81%E6%AD%A4%E5%8A%9F%E8%83%BD%E3%80%82)

---

_[View the full topic](https://meta.discourse.org/t/allow-admins-the-option-to-show-the-header-language-switcher-even-for-logged-in-users/378686)._
