mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-09 11:12:01 +00:00
feat: localized messages (#328)
* fix: project by id loads project from view and from eventstore * fix: correct search key for role * feat(auth): my user changes * fix: improve error handling in change converters * fix: log-id * feat(translations): event type translations * feat: localized translations * fix(translations): correct yaml format * chore: example * fix: remove unused code * correct checkSSL in sql * chore(modules): update * chore: refactor interceptors * fix: improvments * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/en.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/en.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/en.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/en.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/en.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/de.yaml Co-authored-by: Florian Forster <florian@caos.ch> * Update internal/static/i18n/en.yaml Co-authored-by: Florian Forster <florian@caos.ch> * chore(translations): start with upper case on Code * chore(middleware): move funcs * add message to grpc web generation * translation in mgmt and fixes * fix authoptions * fix console statik Co-authored-by: Florian Forster <florian@caos.ch> Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -14,14 +14,14 @@ const (
|
||||
)
|
||||
|
||||
type Renderer struct {
|
||||
Templates map[string]*template.Template
|
||||
i18n *Translator
|
||||
Templates map[string]*template.Template
|
||||
translator *Translator
|
||||
}
|
||||
|
||||
func NewRenderer(templatesDir string, tmplMapping map[string]string, funcs map[string]interface{}, translatorConfig TranslatorConfig) (*Renderer, error) {
|
||||
var err error
|
||||
r := new(Renderer)
|
||||
r.i18n, err = NewTranslator(translatorConfig)
|
||||
r.translator, err = NewTranslator(translatorConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -36,14 +36,14 @@ func (r *Renderer) RenderTemplate(w http.ResponseWriter, req *http.Request, tmpl
|
||||
}
|
||||
|
||||
func (r *Renderer) Localize(id string, args map[string]interface{}) string {
|
||||
return r.i18n.Localize(id, args)
|
||||
return r.translator.Localize(id, args)
|
||||
}
|
||||
|
||||
func (r *Renderer) LocalizeFromRequest(req *http.Request, id string, args map[string]interface{}) string {
|
||||
return r.i18n.LocalizeFromRequest(req, id, args)
|
||||
return r.translator.LocalizeFromRequest(req, id, args)
|
||||
}
|
||||
func (r *Renderer) Lang(req *http.Request) language.Tag {
|
||||
return r.i18n.Lang(req)
|
||||
return r.translator.Lang(req)
|
||||
}
|
||||
|
||||
func (r *Renderer) loadTemplates(templatesDir string, tmplMapping map[string]string, funcs map[string]interface{}) {
|
||||
|
Reference in New Issue
Block a user