aboutsummaryrefslogtreecommitdiffhomepage
path: root/http/handler/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'http/handler/context.go')
-rw-r--r--http/handler/context.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/http/handler/context.go b/http/handler/context.go
index 119a4d5..2d70271 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.