# 搜索栏提示文本替换未生效

**URL:** https://meta.discourse.org/t/search-bar-tips-text-replacement-not-applying/393096
**Category:** Bug
**Created:** [2026年一月9日 17:42 UTC](https://meta.discourse.org/t/search-bar-tips-text-replacement-not-applying/393096 "2026-01-09T17:42:03Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2026年一月9日 23:59 UTC](https://meta.discourse.org/t/search-bar-tips-text-replacement-not-applying/393096/7 "2026-01-09T23:59:51Z")

</div>

干得好，我们似乎有一些翻译无法通过“站点文本”功能动态修改，因为它们是\_硬编码\_在 JavaScript 包中，而不是在运行时\_延迟\_评估的。

我有一个草稿 PR，但我需要确保它没有破坏任何插件/主题

> <https://github.com/discourse/discourse/pull/37041>
>
> When \`i18n()\` is called at module load time (in const declarations or class prop…erty initializers), translations are captured once and never update. This prevents Site Text customizations from being reflected until a full page reload, even for newly rendered components.
> 
> This change moves \`i18n()\` calls to be resolved lazily:
> 
> \- \`random-quick-tip.gjs\`: Store translation keys in \`DEFAULT\_QUICK\_TIPS\` and resolve them via \`tipLabel\`/\`tipDescription\` getters. Maintains backward compatibility for plugins using \`addQuickSearchRandomTip()\`.
> 
> \- \`keyboard-shortcuts-help.gjs\`: Move modifier key translations into \`getModifierKeys()\` helper called from the shortcuts getter.
> 
> \- \`template-form-fields.js\`: Convert exported const to a function that returns fresh translations on each call.
> 
> \- Preferences controllers: Convert \`subpageTitle\` class properties to getters across all 8 preference controllers.
> 
> Ref - https://meta.discourse.org/t/-/393096

---

_[View the full topic](https://meta.discourse.org/t/search-bar-tips-text-replacement-not-applying/393096)._
