# Globally replace translations

**URL:** https://meta.discourse.org/t/globally-replace-translations/315695
**Category:** Plugin
**Created:** [July 10, 2024, 9:59am UTC](https://meta.discourse.org/t/globally-replace-translations/315695 "2024-07-10T09:59:03Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [July 10, 2024, 9:59am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/1 "2024-07-10T09:59:03Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **Summary** | This plugin allows you to globally replace certain words in the translation |
| 🛠 | **Repository Link** | [https://github.com/Lhcfl/replace-translations-global](https://github.com/Lhcfl/replace-translations-global) |
| 📖 | **Install Guide** | [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157) |

  

### Features

Literally, replace all occurrences of a word with another word

For example, replace “Topic” with “Nya”:

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

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

### Configuration

I believe its settings are self-explanatory 🙂

Note that translations are cached and changing them takes time. You can do this to force update:

```plaintext
sudo ./launcher enter app
rm -rf tmp

```

---

<div class="post-metadata">

### Author: ![CAKE\_NICE](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cake_nice/32/400517_2.png) [@CAKE\_NICE](https://meta.discourse.org/u/CAKE_NICE)
#### Post date: [July 22, 2024, 8:23am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/2 "2024-07-22T08:23:46Z")

</div>

Can this replace the official custom text?

> **[Discourse自定义文本批量修改问题](https://www.isharkfly.com/t/discourse/16013)**
>
> 因为我的网站受众用户大多是学生 ，他们很多人都不太理解话题的意思，我想改为“帖子”可是键值太多了，如何批量操作呢？ GPT告诉我的是导出YAML文件？

This is the problem I’m currently encountering: **I cannot modify those key-values in bulk!**

Or @Lhc_fl do you have a better method?

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [July 22, 2024, 8:45am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/3 "2024-07-22T08:45:45Z")

</div>

This plugin is used for batch replacement of translations. However, due to caching, you may need to rebuild after replacement for it to take effect.

---

<div class="post-metadata">

### Author: ![CAKE\_NICE](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cake_nice/32/400517_2.png) [@CAKE\_NICE](https://meta.discourse.org/u/CAKE_NICE)
#### Post date: [July 22, 2024, 8:47am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/4 "2024-07-22T08:47:15Z")

</div>

Is there no batch modification method provided by Discourse itself? For example, exporting a YAML file and replacing it via VS Code?

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [July 22, 2024, 8:54am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/5 "2024-07-22T08:54:24Z")

</div>

There is no such method, you can only change them one by one

---

<div class="post-metadata">

### Author: ![CAKE\_NICE](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cake_nice/32/400517_2.png) [@CAKE\_NICE](https://meta.discourse.org/u/CAKE_NICE)
#### Post date: [July 22, 2024, 8:55am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/6 "2024-07-22T08:55:08Z")

</div>

Then your tools are indeed very good!

---

<div class="post-metadata">

### Author: ![CAKE\_NICE](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cake_nice/32/400517_2.png) [@CAKE\_NICE](https://meta.discourse.org/u/CAKE_NICE)
#### Post date: [July 22, 2024, 9:01am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/7 "2024-07-22T09:01:17Z")

</div>

Does every change require a manual rebuild with ./launcher rebuild app?  
sudo ./launcher enter app  
rm -rf tmp  
I haven’t found its use.

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [July 22, 2024, 9:06am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/8 "2024-07-22T09:06:29Z")

</div>

Try `./launcher restart app` first (after deleting tmp)?

I deleted tmp in the development environment, so it might have been automatically applied here.

If that doesn’t work, try rebuilding. The language files might be pre-compiled, and the plugin’s mechanism interferes with the function that reads the language yml, running only on the first load.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 22, 2024, 9:31am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/9 "2024-07-22T09:31:22Z")

</div>

Just a reminder that including an English translation makes it much easier for others to follow along, 🙏

---

<div class="post-metadata">

### Author: ![CAKE\_NICE](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cake_nice/32/400517_2.png) [@CAKE\_NICE](https://meta.discourse.org/u/CAKE_NICE)
#### Post date: [July 22, 2024, 9:38am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/10 "2024-07-22T09:38:05Z")

</div>

I just tried it, and it will oops, it’s better to rebuild it to be stable.

---

<div class="post-metadata">

### Author: ![tomtjes](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tomtjes/32/131271_2.png) [@tomtjes](https://meta.discourse.org/u/tomtjes)
#### Post date: [February 23, 2025, 12:33am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/11 "2025-02-23T00:33:07Z")

</div>

If using this to substitute another term for _category_ be aware that this plugin also replaces the word in templates such as `{category}`, leading to errors in the UI. To avoid this, I’m using the regex  
`en:(?<!\{)category(?!\})=>chapter`  
in the plugin settings, but perhaps the plugin should be adjusted to only target user-facing content.

---

<div class="post-metadata">

### Author: ![stephtara](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephtara/32/517827_2.png) [@stephtara](https://meta.discourse.org/u/stephtara)
#### Post date: [February 14, 2026, 9:38pm UTC](https://meta.discourse.org/t/globally-replace-translations/315695/12 "2026-02-14T21:38:35Z")

</div>

> [@tomtjes](#):
>
> perhaps the plugin should be adjusted to only target user-facing content

@Lhc_fl any plans for this? Your plugin seems to be what I need to fix some of the terminology for my community in French, but I’m worried about breaking stuff as described in the post above by tomtjes.

---

<div class="post-metadata">

### Author: ![Lxk520](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lxk520/32/550353_2.png) [@Lxk520](https://meta.discourse.org/u/Lxk520)
#### Post date: [April 19, 2026, 4:44am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/13 "2026-04-19T04:44:13Z")

</div>

Why did the replacement fail?

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/5/0/d50c593f167e690e51609ad7922b6f0048be56ee.png)

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [April 19, 2026, 5:07am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/15 "2026-04-19T05:07:29Z")

</div>

(This is the [Globally replace translations](https://meta.discourse.org/t/globally-replace-translations/315695) plugin)

Perhaps you need to use `=>` instead, as in the = and \> signs? The arrow in your screenshot doesn’t look correct.

---

<div class="post-metadata">

### Author: ![Lxk520](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lxk520/32/550353_2.png) [@Lxk520](https://meta.discourse.org/u/Lxk520)
#### Post date: [April 19, 2026, 5:20am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/16 "2026-04-19T05:20:26Z")

</div>

The use of symbols is indeed correct; they are separate = and \> symbols. It only appears that they are connected due to a display issue.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [April 19, 2026, 5:22am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/17 "2026-04-19T05:22:53Z")

</div>

Understood, in any case, this should be moved to that plugin’s topic, as it is not #official.

---

<div class="post-metadata">

### Author: ![Lxk520](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lxk520/32/550353_2.png) [@Lxk520](https://meta.discourse.org/u/Lxk520)
#### Post date: [April 19, 2026, 5:29am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/18 "2026-04-19T05:29:25Z")

</div>

Okay, understood. Thanks for letting me know. (Why do I need to reach 20 characters to reply?)

---

<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: [April 19, 2026, 5:33am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/19 "2026-04-19T05:33:29Z")

</div>

If I understand the code correctly, the plugin uses `JsLocaleHelper` to replace the text used in the frontend (the content of `client.*.yml`). `server.*.yml`, which for example contains the descriptions of site settings, remains unchanged.

Is “`azy videos` just an example of what you want to use the plugin for? The plugin was designed to replace a specific term across a large number of texts. Since this text only appears once in the forum, you could just edit the text directly without using the plugin. There is a guide on how to do that: [Customize text in Discourse](https://meta.discourse.org/t/customize-text-in-discourse/36092)

 ![Screenshot_20260419_070959_Firefox](https://global.discourse-cdn.com/meta/original/4X/3/9/f/39fbf8ea4530b370a52b4e310073adfb768f619e.jpeg)

---

<div class="post-metadata">

### Author: ![Lxk520](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lxk520/32/550353_2.png) [@Lxk520](https://meta.discourse.org/u/Lxk520)
#### Post date: [April 19, 2026, 6:00am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/20 "2026-04-19T06:00:03Z")

</div>

I want to modify these English texts, but I can’t find them.

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/a/1/aa1498e63cc9732a97e9e4c6171836ad5d84ca4f.png)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/5/e/d/5edb87fcde0729836a5e29309eab3efa84148399.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: [April 19, 2026, 7:10am UTC](https://meta.discourse.org/t/globally-replace-translations/315695/21 "2026-04-19T07:10:39Z")

</div>

Those are the names of the settings. I explained why they are not translatable in [有没有比较好的中文插件 - #2 by Moin](https://meta.discourse.org/t/topic/400973/2).  
You cannot customize texts that aren’t translatable in the admin interface.

By the way, if I happened to overlook something regarding this plugin’s ability to also modify backend text, I’m still pretty sure that it only changes translatable text, not other text in the interface. It’s about replacing words in texts, not allowing the translation of untranslatable texts.
