# "translation missing" error after changing text content

**URL:** https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254
**Category:** Support
**Created:** [March 2, 2017, 9:08pm UTC](https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254 "2017-03-02T21:08:27Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [March 2, 2017, 9:08pm UTC](https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254/1 "2017-03-02T21:08:27Z")

</div>

I edited `discourse_narrative_bot.timeout.message` under `admin/customize/site_texts` and thought that was a straight forward and simple job, but either I did something wrong or there is a bug because the discobot no longer displays its timeout message but says instead `translation missing: en.discourse_narrative_bot.timeout.message`

If this is not a bug, my interpretation is that it is not really missing a translation (since I’m using only one locale and that is the english one) but that it does not recognize the text I edited as legitimate for some reason. Is there something else I need to do to get this working? There are no special characters in my text except for `%{site_name}`, a link, a dash, two `"`, two `**`

When I revert back to the default message text, it works again. Is there a character limit or something, @tgxworld?

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [March 3, 2017, 5:56am UTC](https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254/2 "2017-03-03T05:56:54Z")

</div>

Did you happen to remove either `%{username}` or `%{discobot_username}`? Those are special variables that we inject and you can’t add new variables.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [March 3, 2017, 7:50am UTC](https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254/3 "2017-03-03T07:50:34Z")

</div>

aha! no, I didn’t remove any of these variables but I did add %{site\_name}. So are you saying that whatever customization I make on discobot messages, I cannot remove any of the variables in the default text and I cannot add any other variable that is not in the default text? Or is this even so with all Text Content snippets?

---

<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: [March 3, 2017, 8:05am UTC](https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254/4 "2017-03-03T08:05:34Z")

</div>

> [@tophee](#):
>
> I cannot remove any of the variables in the default text and I cannot add any other variable that is not in the default text?

While there is no way adding a variable can work (how is the code supposed to know what to replace it with? ;)) I think being able to remove variables might be worth supporting. At the very least, the error message should be improved to let the user know they’re missing variables.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [March 3, 2017, 8:44am UTC](https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254/6 "2017-03-03T08:44:42Z")

</div>

Okay, so just to understand how this works because I am not familiar with the code: are these variables not global variables? Or at least global in all machine generated text? You seem to be implying that, at least in discobot, each variable is re-invented for each text-snippet rather than having a pool of variables that is valid at least for all discobot messages and that can be drawn on when composing a snippet. Is that so?

---

<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: [March 3, 2017, 8:48am UTC](https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254/7 "2017-03-03T08:48:03Z")

</div>

Every time we use a _translatable_ text in the application, we do something like

```rails
I18n.t("name_of_the_string")

```

When there are variables, we do something like

```rails
I18n.t("with_variables", { variable_1: "foo", variable_2: "bar" })

```

So, no global pool of variables available. Just the ones required for that specific text 😉

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [March 3, 2017, 8:49am UTC](https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254/8 "2017-03-03T08:49:56Z")

</div>

Interestingly, this means that the same word can be translated differently in different contexts, right?

---

<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: [March 3, 2017, 8:54am UTC](https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254/9 "2017-03-03T08:54:24Z")

</div>

Yes, it all depends on what the developer used. I am open to fix any inconsistencies though.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [March 3, 2017, 9:06am UTC](https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254/10 "2017-03-03T09:06:43Z")

</div>

> [@zogstrip](#):
>
> I am open to fix any inconsistencies though.

I think it would help a great deal if, as you suggested, the user could be alerted to the limitations that exist in editing those snippets. It would safe people a lot of time…

But I am still trying to understand whether what you are saying is specific to the discobot plugin or whether these limitations exist for all editable Text Content snippets. In the latter case, it would be a task for the core developers to somehow alert the user.

---

<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: [March 3, 2017, 9:09am UTC](https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254/11 "2017-03-03T09:09:23Z")

</div>

> [@tophee](#):
>
> But I am still trying to understand whether what you are saying is specific to the discobot plugin or whether these limitations exist for all editable Text Content snippets.

They are not limited to discobot. They exist for **all** editable text.

---

<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: [June 8, 2024, 12:44pm UTC](https://meta.discourse.org/t/translation-missing-error-after-changing-text-content/58254/12 "2024-06-08T12:44:59Z")

</div>

This topic was automatically closed after 2654 days. New replies are no longer allowed.
