mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-18 13:57:32 +00:00
42384763d1
* Label Policy added * save * chore: update docs action * Save * Save * Get colors from DB * Variables inserted * Get images from global directory. * Add tests * Add tests * Corrections from mergerequest * Corrections from mergerequest * Test corrected. * Added colors to all notifications. * Added colors to Corrected text and formatting.all notifications. * Spelling error corrected. * fix: tests * Merge Branch corrected. * Step6 added * Corrections from mergerequest * fix: generate management * Formatted texts. * fix: migrations Co-authored-by: Florian Forster <florian@caos.ch> Co-authored-by: adlerhurst <silvan.reusser@gmail.com> Co-authored-by: Fabiennne <fabienne.gerschwiler@gmail.com>
30 lines
859 B
Go
30 lines
859 B
Go
package templates
|
|
|
|
import (
|
|
"html"
|
|
|
|
"github.com/caos/zitadel/internal/i18n"
|
|
)
|
|
|
|
type TemplateData struct {
|
|
Title string
|
|
PreHeader string
|
|
Subject string
|
|
Greeting string
|
|
Text string
|
|
Href string
|
|
ButtonText string
|
|
PrimaryColor string
|
|
SecondaryColor string
|
|
}
|
|
|
|
func (data *TemplateData) Translate(i18n *i18n.Translator, args map[string]interface{}, langs ...string) {
|
|
data.Title = i18n.Localize(data.Title, nil, langs...)
|
|
data.PreHeader = i18n.Localize(data.PreHeader, nil, langs...)
|
|
data.Subject = i18n.Localize(data.Subject, nil, langs...)
|
|
data.Greeting = i18n.Localize(data.Greeting, args, langs...)
|
|
data.Text = html.UnescapeString(i18n.Localize(data.Text, args, langs...))
|
|
data.Href = i18n.Localize(data.Href, nil, langs...)
|
|
data.ButtonText = i18n.Localize(data.ButtonText, nil, langs...)
|
|
}
|