diff --git a/internal/notification/templates/templateData.go b/internal/notification/templates/templateData.go index 29a74f3328..f9572a4c5d 100644 --- a/internal/notification/templates/templateData.go +++ b/internal/notification/templates/templateData.go @@ -42,5 +42,11 @@ func (data *TemplateData) Translate(translator *i18n.Translator, msgType string, data.Greeting = translator.Localize(fmt.Sprintf("%s.%s", msgType, domain.MessageGreeting), args, langs...) data.Text = html.UnescapeString(translator.Localize(fmt.Sprintf("%s.%s", msgType, domain.MessageText), args, langs...)) data.ButtonText = translator.Localize(fmt.Sprintf("%s.%s", msgType, domain.MessageButtonText), args, langs...) - data.FooterText = translator.Localize(fmt.Sprintf("%s.%s", msgType, domain.MessageFooterText), args, langs...) + // Footer text is neither included in i18n files nor defaults.yaml + footerText := fmt.Sprintf("%s.%s", msgType, domain.MessageFooterText) + data.FooterText = translator.Localize(footerText, args, langs...) + // translator returns the id of the string to be translated if no translation is found for that id + // we'll include the footer if we have a custom non-empty string and if the string doesn't include the + // id of the string that could not be translated example InitCode.Footer + data.IncludeFooter = len(data.FooterText) > 0 && data.FooterText != footerText }