Translations for login form

This commit is contained in:
Jan Dittberner 2021-01-01 12:40:12 +01:00
parent 82918fb782
commit 714a07f162
5 changed files with 71 additions and 4 deletions

View file

@ -18,6 +18,16 @@ other = "Dieses Feld wird benötigt."
hash = "sha1-e5fd9aa24c9417e7332e6f25936ae2a6ec8f1524" hash = "sha1-e5fd9aa24c9417e7332e6f25936ae2a6ec8f1524"
other = "Unbekannter Fehler" other = "Unbekannter Fehler"
[FormLabelEmail]
description = "Label for an email form field"
hash = "sha1-ce1aa6771caccb8c901c6627e7ab5c554e9944da"
other = "E-Mail:"
[FormLabelPassword]
description = "Label for a password form field"
hash = "sha1-a3c9deb12ea191bb380ea7ad076417b1fff14f28"
other = "Passwort:"
[IndexGreeting] [IndexGreeting]
hash = "sha1-d4a13058e497fa24143ea96d50d82b818455ef61" hash = "sha1-d4a13058e497fa24143ea96d50d82b818455ef61"
other = "Hallo {{ .User }}" other = "Hallo {{ .User }}"
@ -42,10 +52,19 @@ other = "Die Anwendung <strong>{{ .client }}</strong> benötigt deine Einwilligu
hash = "sha1-5e56a367cf99015bbe98488845541db00b7e04f6" hash = "sha1-5e56a367cf99015bbe98488845541db00b7e04f6"
other = "Ich erteile hiermit meine Einwilligung, dass die Anwendung die angefragten Berechtigungen erhalten darf." other = "Ich erteile hiermit meine Einwilligung, dass die Anwendung die angefragten Berechtigungen erhalten darf."
[LabelLogin]
description = "Label for a login button"
hash = "sha1-ff00822024fca849fe0cef21237b57218e706852"
other = "Anmelden"
[LabelSubmit] [LabelSubmit]
hash = "sha1-2dacf65959849884a011f36f76a04eebea94c5ea" hash = "sha1-2dacf65959849884a011f36f76a04eebea94c5ea"
other = "Abschicken" other = "Abschicken"
[LoginTitle]
hash = "sha1-4e5a2893bdcc7d239c1db72e4c4ffbe4bea73174"
other = "Anmeldung"
[LogoutLabel] [LogoutLabel]
description = "A label on a logout button or link" description = "A label on a logout button or link"
hash = "sha1-8acfdeb9a8286f00c8e5dd48471cfdc994807579" hash = "sha1-8acfdeb9a8286f00c8e5dd48471cfdc994807579"

View file

@ -10,6 +10,7 @@ IntroConsentMoreInformation = "You can find more information about <strong>{{ .c
IntroConsentRequested = "The <strong>{{ .client }}</strong> application wants your consent for the requested set of permissions." IntroConsentRequested = "The <strong>{{ .client }}</strong> application wants your consent for the requested set of permissions."
LabelConsent = "I hereby agree that the application may get the requested permissions." LabelConsent = "I hereby agree that the application may get the requested permissions."
LabelSubmit = "Submit" LabelSubmit = "Submit"
LoginTitle = "Login"
Scope-email-Description = "Access your primary email address." Scope-email-Description = "Access your primary email address."
Scope-offline_access-Description = "Keep access to your information until you revoke the permission." Scope-offline_access-Description = "Keep access to your information until you revoke the permission."
Scope-openid-Description = "Request information about your identity." Scope-openid-Description = "Request information about your identity."
@ -17,6 +18,18 @@ Scope-profile-Description = "Access your user profile information including your
TitleRequestConsent = "Application requests your consent" TitleRequestConsent = "Application requests your consent"
WrongOrLockedUserOrInvalidPassword = "You entered an invalid username or password or your account has been locked." WrongOrLockedUserOrInvalidPassword = "You entered an invalid username or password or your account has been locked."
[FormLabelEmail]
description = "Label for an email form field"
other = "Email:"
[FormLabelPassword]
description = "Label for a password form field"
other = "Password:"
[LabelLogin]
description = "Label for a login button"
other = "Login"
[LogoutLabel] [LogoutLabel]
description = "A label on a logout button or link" description = "A label on a logout button or link"
other = "Logout" other = "Logout"

View file

@ -38,7 +38,7 @@ func (m *MessageCatalog) LookupErrorMessage(tag string, field string, value inte
m.logger.Infof("no specific error message %s", tag) m.logger.Infof("no specific error message %s", tag)
message, ok = m.messages["unknown"] message, ok = m.messages["unknown"]
if !ok { if !ok {
m.logger.Error("no default translation found") m.logger.Warnf("no default translation found")
return tag return tag
} }
} }
@ -69,6 +69,7 @@ func (m *MessageCatalog) LookupMessage(id string, templateData map[string]interf
} }
return translation return translation
} else { } else {
m.logger.Warnf("no translation found for %s", id)
return id return id
} }
} }

View file

@ -70,5 +70,24 @@ func AddMessages(ctx context.Context) {
ID: "WrongOrLockedUserOrInvalidPassword", ID: "WrongOrLockedUserOrInvalidPassword",
Other: "You entered an invalid username or password or your account has been locked.", Other: "You entered an invalid username or password or your account has been locked.",
} }
messages["LoginTitle"] = &i18n.Message{
ID: "LoginTitle",
Other: "Login",
}
messages["LabelEmail"] = &i18n.Message{
ID: "FormLabelEmail",
Description: "Label for an email form field",
Other: "Email:",
}
messages["LabelPassword"] = &i18n.Message{
ID: "FormLabelPassword",
Description: "Label for a password form field",
Other: "Password:",
}
messages["LabelLogin"] = &i18n.Message{
ID: "LabelLogin",
Description: "Label for a login button",
Other: "Login",
}
services.GetMessageCatalog(ctx).AddMessages(messages) services.GetMessageCatalog(ctx).AddMessages(messages)
} }

View file

@ -1,3 +1,18 @@
[WrongOrLockedUserOrInvalidPassword] [FormLabelEmail]
hash = "sha1-87e0a0ac67c6c3a06bed184e10b22aae4d075b64" description = "Label for an email form field"
other = "Du hast einen ungültigen Nutzernamen oder ein ungültiges Passwort eingegeben oder dein Benutzerkonto wurde gesperrt." hash = "sha1-ce1aa6771caccb8c901c6627e7ab5c554e9944da"
other = "E-Mail:"
[FormLabelPassword]
description = "Label for a password form field"
hash = "sha1-a3c9deb12ea191bb380ea7ad076417b1fff14f28"
other = "Passwort:"
[LabelLogin]
description = "Label for a login button"
hash = "sha1-ff00822024fca849fe0cef21237b57218e706852"
other = "Anmelden"
[LoginTitle]
hash = "sha1-4e5a2893bdcc7d239c1db72e4c4ffbe4bea73174"
other = "Anmeldung"