diff options
author | Corey Hulen <corey@hulen.com> | 2016-01-21 14:36:46 -0600 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-01-21 14:36:46 -0600 |
commit | 6c86bae5d54a2f24733512e6c9eee78a832a45e3 (patch) | |
tree | 4e1db4ba11bc8dff70a8049ab887588686fa4d47 /api/context.go | |
parent | a2fa683c1b5fc0c62506e3ac40784b053eda6e3e (diff) | |
parent | 3ff05780a1b4f08d256a983bc9ec06f9841f0538 (diff) | |
download | chat-6c86bae5d54a2f24733512e6c9eee78a832a45e3.tar.gz chat-6c86bae5d54a2f24733512e6c9eee78a832a45e3.tar.bz2 chat-6c86bae5d54a2f24733512e6c9eee78a832a45e3.zip |
Merge pull request #1949 from mattermost/PLT-7-client-infra
PLT-7 client infra
Diffstat (limited to 'api/context.go')
-rw-r--r-- | api/context.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/api/context.go b/api/context.go index b152d6da8..f47ed1c30 100644 --- a/api/context.go +++ b/api/context.go @@ -31,6 +31,7 @@ type Context struct { siteURL string SessionTokenIndex int64 T goi18n.TranslateFunc + Locale string } type Page struct { @@ -43,6 +44,7 @@ type Page struct { Channel *model.Channel PostID string SessionTokenIndex int64 + Locale string } func ApiAppHandler(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler { @@ -86,7 +88,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { l4g.Debug("%v", r.URL.Path) c := &Context{} - c.T = utils.GetTranslations(w, r) + c.T, c.Locale = utils.GetTranslationsAndLocale(w, r) c.RequestId = model.NewId() c.IpAddress = GetIpAddress(r) |