diff options
-rw-r--r-- | api/context.go | 8 | ||||
-rw-r--r-- | api4/context.go | 8 | ||||
-rw-r--r-- | utils/i18n.go | 2 |
3 files changed, 10 insertions, 8 deletions
diff --git a/api/context.go b/api/context.go index 282b45c86..117fff708 100644 --- a/api/context.go +++ b/api/context.go @@ -281,14 +281,14 @@ func (c *Context) LogError(err *model.AppError) { if c.Path == "/api/v3/users/websocket" && err.StatusCode == 401 || err.Id == "web.check_browser_compatibility.app_error" { c.LogDebug(err) } else { - l4g.Error(utils.T("api.context.log.error"), c.Path, err.Where, err.StatusCode, - c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.T), err.DetailedError) + l4g.Error(utils.TDefault("api.context.log.error"), c.Path, err.Where, err.StatusCode, + c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.TDefault), err.DetailedError) } } func (c *Context) LogDebug(err *model.AppError) { - l4g.Debug(utils.T("api.context.log.error"), c.Path, err.Where, err.StatusCode, - c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.T), err.DetailedError) + l4g.Debug(utils.TDefault("api.context.log.error"), c.Path, err.Where, err.StatusCode, + c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.TDefault), err.DetailedError) } func (c *Context) UserRequired() { diff --git a/api4/context.go b/api4/context.go index 5522d1836..32db0ed7d 100644 --- a/api4/context.go +++ b/api4/context.go @@ -227,14 +227,14 @@ func (c *Context) LogError(err *model.AppError) { if c.Path == "/api/v3/users/websocket" && err.StatusCode == 401 || err.Id == "web.check_browser_compatibility.app_error" { c.LogDebug(err) } else { - l4g.Error(utils.T("api.context.log.error"), c.Path, err.Where, err.StatusCode, - c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.T), err.DetailedError) + l4g.Error(utils.TDefault("api.context.log.error"), c.Path, err.Where, err.StatusCode, + c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.TDefault), err.DetailedError) } } func (c *Context) LogDebug(err *model.AppError) { - l4g.Debug(utils.T("api.context.log.error"), c.Path, err.Where, err.StatusCode, - c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.T), err.DetailedError) + l4g.Debug(utils.TDefault("api.context.log.error"), c.Path, err.Where, err.StatusCode, + c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.TDefault), err.DetailedError) } func (c *Context) IsSystemAdmin() bool { diff --git a/utils/i18n.go b/utils/i18n.go index 5a0bb197f..cb5aca568 100644 --- a/utils/i18n.go +++ b/utils/i18n.go @@ -12,6 +12,7 @@ import ( ) var T i18n.TranslateFunc +var TDefault i18n.TranslateFunc var locales map[string]string = make(map[string]string) var settings model.LocalizationSettings @@ -20,6 +21,7 @@ var settings model.LocalizationSettings func TranslationsPreInit() { InitTranslationsWithDir("i18n") T = TfuncWithFallback("en") + TDefault = TfuncWithFallback("en") } func InitTranslations(localizationSettings model.LocalizationSettings) { |