# 过时的翻译替换导致缺失翻译

**URL:** https://meta.discourse.org/t/outdated-translation-replacement-causing-missing-translation/314352
**Category:** Bug
**Tags:** translation, fixed
**Created:** [2024年六月30日 13:26 UTC](https://meta.discourse.org/t/outdated-translation-replacement-causing-missing-translation/314352 "2024-06-30T13:26:14Z")
**Posts on this page:** 1
**Showing post:** 11

<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日 09:18 UTC](https://meta.discourse.org/t/outdated-translation-replacement-causing-missing-translation/314352/11 "2024-07-01T09:18:01Z")

</div>

我认为这与以下内容有关：

> [@Admin -\> Customize -\> Text behaving badly](https://meta.discourse.org/t/admin-customize-text-behaving-badly/285691/5?u=moin):
>
> This happens when there’s a translation override for a key that previously was a translatable string, but was converted into a Hash at a later time. That’s exactly what [happened](https://github.com/merefield/discourse-chatbot/commit/f72e39908f8cb0421164bc3c3cad832d683e2e62#diff-333c4c8cacc2f84633d4894f2aaddb130a6d74f42dd63199462b3d66278f6ce8) with chatbot.prompt.system. This seems like a regression. I’m pretty sure this used to work in the past. I can easily reproduce this with a locale file like this: en: foo: "this is foo" Go to Customize → Text and override “foo” with a different value. Then, change the locale file to look like this: en: foo: …

我能够重现土耳其语中“preferences”字符串损坏的问题。在更新之前，我自定义了 `js.user.preferences`，更新后，新的 `js.user.preferences.title` 出现了问题。  
然后我运行了：

```plaintext
TranslationOverride.where(translation_key: "js.user.preferences").delete_all
TranslationOverride.send(:reload_locale!)

```

这解决了问题 🎉

不过，在生产环境上自行尝试之前，我会等待更有知识的人进行确认。

---

_[View the full topic](https://meta.discourse.org/t/outdated-translation-replacement-causing-missing-translation/314352)._
