A user, Phyks, reported an issue with HTML tags in plaintext email digests when a translation is missing. The issue occurs when a server lacks a translation for a specific locale, in this case, French. The resulting email contains HTML tags, such as <span class="translation_missing" title="translation missing: fr.user_notifications.digest.unsubscribe">Unsubscribe</span>.
Phyks argued that this is a bug, as the plaintext version should not contain HTML tags, even if a translation is missing. sam initially stated that it was not a bug, but rather a missing French translation. However, Phyks and neil pointed out that the issue is not just about the missing translation, but also about the HTML tags being included in the plaintext version.
neil later discovered that the issue might have been fixed in a recent update, as the email notification path changed last year. After deleting some French translations, neil found that the text version of the digest was using English where French strings were missing, and there were no HTML tags present.
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, but is not available in the French locale.
Resulting email has following content in plaintext:
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.
Il percorso seguito dalle notifiche email è cambiato l’anno scorso, il che potrebbe aver risolto il problema? Ho eliminato alcune traduzioni in francese e posso vedere che la versione testuale del riepilogo utilizza l’inglese laddove mancano le stringhe in francese, e non c’è alcun tag HTML span.
Questo riepilogo viene inviato da [Localhost][1] quando non ti vediamo da un po'. Modifica le [tue preferenze di posta elettronica][7] o [clicca qui][8] per annullare l'iscrizione.