# Cannot customize some site texts

**URL:** https://meta.discourse.org/t/cannot-customize-some-site-texts/387463
**Category:** Development
**Created:** [November 3, 2025, 2:45pm UTC](https://meta.discourse.org/t/cannot-customize-some-site-texts/387463 "2025-11-03T14:45:32Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![pangbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pangbo/32/538562_2.png) [@pangbo](https://meta.discourse.org/u/pangbo)
#### Post date: [November 3, 2025, 2:45pm UTC](https://meta.discourse.org/t/cannot-customize-some-site-texts/387463/1 "2025-11-03T14:45:32Z")

</div>

I’m attempting to modify certain strings on the user preferences page. I navigated to _Admin → Site Texts_ and searched for the relevant keys. However, I was unable to customize the specific text I was looking for as it told me there were no texts found.

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/2/3/423d4fbde3ee455634bf585205f4458991886d61.png)

I am reasonably certain that the key is valid, as it is defined here:

> <https://github.com/discourse/discourse/blob/056f73c6f1ebf96e49b5bb1a1efece7127ca95a5/config/locales/client.zh_CN.yml#L1796>

I then switched the target language to English but still yielded no results for `user.username.short_instructions`. Furthermore, I attempted to search for other strings such as `user.username.title`, `user.preferences.title`, and `filters.latest.title`, and no results either.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [November 3, 2025, 3:03pm UTC](https://meta.discourse.org/t/cannot-customize-some-site-texts/387463/2 "2025-11-03T15:03:16Z")

</div>

Very strange, I’m able to pull up the key

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/b/4/2b4ba9bac59168f37eb6d83efa25955ef28d7d70.png)

> [@pangbo](#):
>
> Furthermore, I attempted to search for other strings such as `user.username.title`, `user.preferences.title`, and `filters.latest.title`, and no results either.

If you right click and open the browser inspector, are there any errors in the console tab?

---

<div class="post-metadata">

### Author: ![pangbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pangbo/32/538562_2.png) [@pangbo](https://meta.discourse.org/u/pangbo)
#### Post date: [November 3, 2025, 3:41pm UTC](https://meta.discourse.org/t/cannot-customize-some-site-texts/387463/3 "2025-11-03T15:41:45Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/6/5/5/655a15704532ca009f4816ff2c766fd077adeced.png)

It looks like there are no related errors, and based on the request results, it may be a backend issue.

Although I don’t believe the plugins I’ve installed have modified this particular area, I will attempt to remove all unofficial plugins later to see if that resolves the problem.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [November 3, 2025, 3:46pm UTC](https://meta.discourse.org/t/cannot-customize-some-site-texts/387463/4 "2025-11-03T15:46:35Z")

</div>

> [@pangbo](#):
>
> I will attempt to remove all unofficial plugins later to see if that resolves the problem.

You can temporarily disable customizations by using [safe mode](https://meta.discourse.org/t/53504?silent=true) and see if that works

---

<div class="post-metadata">

### Author: ![pangbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pangbo/32/538562_2.png) [@pangbo](https://meta.discourse.org/u/pangbo)
#### Post date: [November 3, 2025, 4:35pm UTC](https://meta.discourse.org/t/cannot-customize-some-site-texts/387463/5 "2025-11-03T16:35:56Z")

</div>

I have some updates regarding this matter. I can now definitively confirm that the issue lies with the backend. While examining the code, I noticed a particular line:

> <https://github.com/discourse/discourse/blob/056f73c6f1ebf96e49b5bb1a1efece7127ca95a5/app/controllers/admin/site_texts_controller.rb#L236>

To my surprise, executing `I18n.exists?("js.user.username.short_instructions", :en)` on my instance returns false.

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/1/c/31cdacd597efd82b5e86ee8b053b39d41eaa4204.png)

I manually removed this line of code, and I am now able to search for `user.username.short_instructions`

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/8/2/a82a1737dc6319c4fdccaf2819387dc484ff97ea.png)

I am uncertain as to why `I18n.exists?("js.user.username.short_instructions", :en)` is returning false. I may investigate further to determine whether the problem is specific to my instance or a more general issue with Discourse.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 6, 2025, 12:50am UTC](https://meta.discourse.org/t/cannot-customize-some-site-texts/387463/6 "2025-11-06T00:50:06Z")

</div>

Feels like a general issue you your Discourse instance.

```plaintext
sam@arch discourse % bin/rails c
Loading development environment (Rails 8.0.4)
[1] pry(main)> I18n.exists?("js.user.username.short_instructions", :en)
=> true

```

Particularly something around build. During build we parse all of this stuff and pop it in tables, somehow this did not happen yet in your instance.

Would recommend a console rebuild.

---

<div class="post-metadata">

### Author: ![pangbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pangbo/32/538562_2.png) [@pangbo](https://meta.discourse.org/u/pangbo)
#### Post date: [November 6, 2025, 6:58am UTC](https://meta.discourse.org/t/cannot-customize-some-site-texts/387463/7 "2025-11-06T06:58:50Z")

</div>

@sam, thank you for your response. I’ve deployed three Discourse instances using different methods, and all exhibit the same issue, leading me to believe it’s not an installation problem.

Upon re-examining my plugins, I discovered that one of them created a locale file (`plugins/XXXX/config/locales/client.en.yml`) with the following content:

```yml
en:
   js:

```

Deleting this file resolved the problem. After a brief investigation into the I18n implementation, I found that `deep_merge` is used to merge translations during loading:

```ruby
    # File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/backend/simple.rb, line 31
31: def store_translations(locale, data, options = {})
32: locale = locale.to_sym
33: translations[locale] ||= {}
34: data = data.deep_symbolize_keys
35: translations[locale].deep_merge!(data)
36: end

```

The YAML above is parsed as:

```json
{"en": {"js": null}}

```

This results in the deletion of the entire content under the `en.js` key after the merge. As a plugin developer, I understand that this issue stems from my own coding error, and I am fully responsible for it. However, I believe Discourse could benefit from additional checks to warn against such occurrences, especially considering that Discourse already has a design for inspecting locale files, as seen [here](https://github.com/discourse/discourse/blob/main/lib/i18n/locale_file_checker.rb).

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 6, 2025, 7:38am UTC](https://meta.discourse.org/t/cannot-customize-some-site-texts/387463/8 "2025-11-06T07:38:32Z")

</div>

Glad you found it!

I will ping the dev xp team so they are aware

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [November 6, 2025, 10:19am UTC](https://meta.discourse.org/t/cannot-customize-some-site-texts/387463/10 "2025-11-06T10:19:31Z")

</div>

Nice catch, thanks for updating us on the solution @pangbo.

> [@pangbo](#):
>
> Discourse already has a design for inspecting locale files, as seen [here](https://github.com/discourse/discourse/blob/main/lib/i18n/locale_file_checker.rb)

We could definitely add a check here, although IIRC this checker is only used during RSpec tests. Would that have helped in your case?

Definitely open to having a runtime check for this `null` case, if we can find a good place to put it.

---

<div class="post-metadata">

### Author: ![pangbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pangbo/32/538562_2.png) [@pangbo](https://meta.discourse.org/u/pangbo)
#### Post date: [November 6, 2025, 10:57am UTC](https://meta.discourse.org/t/cannot-customize-some-site-texts/387463/11 "2025-11-06T10:57:01Z")

</div>

You are correct. I made an unwarranted assumption that these checks would execute at runtime. Upon searching the GitHub repository, it appears these checks are invoked solely within a rake task:

> <https://github.com/discourse/discourse/blob/main/lib/tasks/i18n.rake#L29-L29>

Adding checks here would not have preemptively identified the issue I encountered. Perhaps the most straightforward solution is to caution developers against this practice in the documentation 😇
