diff options
author | 2018-04-27 22:07:46 -0700 | |
---|---|---|
committer | 2018-04-27 22:07:46 -0700 | |
commit | ddd3af4b85f5a2fe85c17a9cc30cf54743b9eb59 (patch) | |
tree | 539b491fc9f67980b09a6ccd282454614a77f8b4 /http/handler/context.go | |
parent | 6b360d08c1f6c8a6cd1b7608f7af734a3ceef8d7 (diff) | |
download | v2-ddd3af4b85f5a2fe85c17a9cc30cf54743b9eb59.tar.gz v2-ddd3af4b85f5a2fe85c17a9cc30cf54743b9eb59.tar.zst v2-ddd3af4b85f5a2fe85c17a9cc30cf54743b9eb59.zip |
Do not use shared variable to translate templates
Diffstat (limited to 'http/handler/context.go')
-rw-r--r-- | http/handler/context.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/http/handler/context.go b/http/handler/context.go index 119a4d5e..2d702710 100644 --- a/http/handler/context.go +++ b/http/handler/context.go @@ -85,7 +85,11 @@ func (c *Context) UserLanguage() string { return user.Language } - return c.getContextStringValue(middleware.UserLanguageContextKey) + language := c.getContextStringValue(middleware.UserLanguageContextKey) + if language == "" { + language = "en_US" + } + return language } // Translate translates a message in the current language. |