# HTML tags in plaintext digest when missing a translation

**URL:** https://meta.discourse.org/t/html-tags-in-plaintext-digest-when-missing-a-translation/68151
**Category:** Bug
**Tags:** activity-summary
**Created:** [16. August 2017 um 11:36 UTC](https://meta.discourse.org/t/html-tags-in-plaintext-digest-when-missing-a-translation/68151 "2017-08-16T11:36:35Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Phyks](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@Phyks](https://meta.discourse.org/u/Phyks)
#### Post date: [16. August 2017 um 11:36 UTC](https://meta.discourse.org/t/html-tags-in-plaintext-digest-when-missing-a-translation/68151/1 "2017-08-16T11:36:35Z")

</div>

Hi,

I subscribed to digests on Discourse instances and read my emails in plaintext. Huge 👍 for having a really usable and readable plaintext version!

However, I recently discovered that some HTML tags were present in the digests when server lacks some translations. For instance, consider the unsubscribe link from the digest, translation is [here](https://github.com/discourse/discourse/blob/master/config/locales/server.en.yml#L2627), but is not available in the French locale.

Resulting email has following content in plaintext:

```plaintext
<span class="translation_missing" title="translation missing: fr.user_notifications.digest.unsubscribe">Unsubscribe</span>

```

with the unsubscribe link reference below. I would have expected it to be something like

```plaintext
Unsubscribe [3]

```

(where `[3]` is the reference of the unsubscribe link at the bottom of the email body).

Thanks!

---

<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: [16. August 2017 um 12:32 UTC](https://meta.discourse.org/t/html-tags-in-plaintext-digest-when-missing-a-translation/68151/2 "2017-08-16T12:32:42Z")

</div>

Not really a bug, its simply a missing french translation see: [Contributing translations to Discourse](https://meta.discourse.org/t/contribute-a-translation-to-discourse/14882)

---

<div class="post-metadata">

### Author: ![Phyks](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@Phyks](https://meta.discourse.org/u/Phyks)
#### Post date: [16. August 2017 um 13:05 UTC](https://meta.discourse.org/t/html-tags-in-plaintext-digest-when-missing-a-translation/68151/3 "2017-08-16T13:05:32Z")

</div>

> [@sam](#):
>
> Not really a bug, its simply a missing french translation

I’d disagree with the fact that it is not a bug. The root of the issue, is that there is a missing French translation, which I totally agree with.

But the issue I am reporting extend beyond the missing French translation. The true issue (in my opinion) is that if a translation is missing, plaintext emails get HTML tags in them. The `span` should be replaced by its content, in the plaintext version, in the case of a missing translation.

---

<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: [16. August 2017 um 13:06 UTC](https://meta.discourse.org/t/html-tags-in-plaintext-digest-when-missing-a-translation/68151/4 "2017-08-16T13:06:44Z")

</div>

Hmm, yeah … that is somewhat odd, we usually fallback to english but not here.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [30. Oktober 2017 um 20:34 UTC](https://meta.discourse.org/t/html-tags-in-plaintext-digest-when-missing-a-translation/68151/6 "2017-10-30T20:34:13Z")

</div>

The fallback to English is happening, but still the span is there.

`<span class="translation_missing" title="translation missing: en.user_notifications.digest.unsubscribe">Unsubscribe</span>`

Notice the word “Unsubscribe” is there. My site was supposed to be French, but it’s saying that the english translation is missing too… So wrong.

> [@Phyks](#):
>
> The true issue (in my opinion) is that if a translation is missing, plaintext emails get HTML tags in them.

ActiveSupport is trying to be helpful by adding that span, and I don’t see a way to stop it in the case that we’re not using it in HTML…

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [28. Januar 2020 um 21:38 UTC](https://meta.discourse.org/t/html-tags-in-plaintext-digest-when-missing-a-translation/68151/7 "2020-01-28T21:38:02Z")

</div>

Der Pfad, den E-Mail-Benachrichtigungen durchlaufen, hat sich letztes Jahr geändert, was dieses Problem möglicherweise behoben hat? Ich habe einige französische Übersetzungen gelöscht und kann sehen, dass die Textversion des Digests Englisch verwendet, wo französische Zeichenfolgen fehlen, und es gibt kein -HTML.

`Diese Zusammenfassung wird von [Localhost][1] gesendet, wenn wir Sie schon eine Weile nicht gesehen haben. Ändern Sie [Ihre E-Mail-Einstellungen][7] oder [klicken Sie hier][8], um sich abzumelden.`

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [28. Januar 2020 um 21:38 UTC](https://meta.discourse.org/t/html-tags-in-plaintext-digest-when-missing-a-translation/68151/8 "2020-01-28T21:38:08Z")

</div>


