From 0344473c1e40ea9d2ef99e65386b8919e8226189 Mon Sep 17 00:00:00 2001 From: Lee Brown Date: Fri, 2 Aug 2019 16:23:13 -0800 Subject: [PATCH] fix translations --- internal/mid/translator.go | 2 -- internal/platform/web/webcontext/transvalidate.go | 2 ++ resources/templates/shared/emails/user_invite.html | 2 +- resources/templates/shared/emails/user_reset_password.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/mid/translator.go b/internal/mid/translator.go index b69a5f3..e5c3634 100644 --- a/internal/mid/translator.go +++ b/internal/mid/translator.go @@ -24,8 +24,6 @@ func Translator(utrans *ut.UniversalTranslator) web.Middleware { m := func() error { locale, _ := params["locale"] - locale = "fr" - var t ut.Translator if len(locale) > 0 { diff --git a/internal/platform/web/webcontext/transvalidate.go b/internal/platform/web/webcontext/transvalidate.go index 3f4b4dc..7a5de28 100644 --- a/internal/platform/web/webcontext/transvalidate.go +++ b/internal/platform/web/webcontext/transvalidate.go @@ -37,6 +37,7 @@ func ContextTranslator(ctx context.Context) ut.Translator { if t, ok := ctx.Value(KeyTranslate).(ut.Translator); ok { return t } + return uniTrans.GetFallback() } @@ -71,6 +72,7 @@ func init() { transNl, _ := uniTrans.GetTranslator(nl.Locale()) transZh, _ := uniTrans.GetTranslator(zh.Locale()) + transEn.Add("{{name}}", "Name", false) transFr.Add("{{name}}", "Nom", false) diff --git a/resources/templates/shared/emails/user_invite.html b/resources/templates/shared/emails/user_invite.html index e8bdd0b..ed12a45 100644 --- a/resources/templates/shared/emails/user_invite.html +++ b/resources/templates/shared/emails/user_invite.html @@ -14,6 +14,6 @@

{{ .FromUser.FirstName }} has invited you to join {{ .Account.Name }}.

To accept the invite, follow this link (or paste into your browser) within the next {{ .Minutes }} minutes.

{{ .Url }}

-

 
- Support

+

 
- Geeks

\ No newline at end of file diff --git a/resources/templates/shared/emails/user_reset_password.html b/resources/templates/shared/emails/user_reset_password.html index 70e8b7d..f11fc82 100644 --- a/resources/templates/shared/emails/user_reset_password.html +++ b/resources/templates/shared/emails/user_reset_password.html @@ -15,6 +15,6 @@

Someone in space has asked to reset the password for your account. If you did not request a password reset, you can disregard this email. No changes have been made to your account.

To reset your password, follow this link (or paste into your browser) within the next {{ .Minutes }} minutes.

{{ .Url }}

-

 
- Support

+

 
- Geeks

\ No newline at end of file