mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 11:34:26 +00:00
fix: footerText has no effect (#6297)
This commit is contained in:
parent
b383892d36
commit
6ca789ad44
@ -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.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.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.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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user