PLT-6322 log error messages in english (#6234)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
d0618afb50
Коммит
a8cf08d6ef
@@ -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" {
|
if c.Path == "/api/v3/users/websocket" && err.StatusCode == 401 || err.Id == "web.check_browser_compatibility.app_error" {
|
||||||
c.LogDebug(err)
|
c.LogDebug(err)
|
||||||
} else {
|
} else {
|
||||||
l4g.Error(utils.T("api.context.log.error"), c.Path, err.Where, err.StatusCode,
|
l4g.Error(utils.TDefault("api.context.log.error"), c.Path, err.Where, err.StatusCode,
|
||||||
c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.T), err.DetailedError)
|
c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.TDefault), err.DetailedError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) LogDebug(err *model.AppError) {
|
func (c *Context) LogDebug(err *model.AppError) {
|
||||||
l4g.Debug(utils.T("api.context.log.error"), c.Path, err.Where, err.StatusCode,
|
l4g.Debug(utils.TDefault("api.context.log.error"), c.Path, err.Where, err.StatusCode,
|
||||||
c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.T), err.DetailedError)
|
c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.TDefault), err.DetailedError)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) UserRequired() {
|
func (c *Context) UserRequired() {
|
||||||
|
|||||||
@@ -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" {
|
if c.Path == "/api/v3/users/websocket" && err.StatusCode == 401 || err.Id == "web.check_browser_compatibility.app_error" {
|
||||||
c.LogDebug(err)
|
c.LogDebug(err)
|
||||||
} else {
|
} else {
|
||||||
l4g.Error(utils.T("api.context.log.error"), c.Path, err.Where, err.StatusCode,
|
l4g.Error(utils.TDefault("api.context.log.error"), c.Path, err.Where, err.StatusCode,
|
||||||
c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.T), err.DetailedError)
|
c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.TDefault), err.DetailedError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) LogDebug(err *model.AppError) {
|
func (c *Context) LogDebug(err *model.AppError) {
|
||||||
l4g.Debug(utils.T("api.context.log.error"), c.Path, err.Where, err.StatusCode,
|
l4g.Debug(utils.TDefault("api.context.log.error"), c.Path, err.Where, err.StatusCode,
|
||||||
c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.T), err.DetailedError)
|
c.RequestId, c.Session.UserId, c.IpAddress, err.SystemMessage(utils.TDefault), err.DetailedError)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) IsSystemAdmin() bool {
|
func (c *Context) IsSystemAdmin() bool {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var T i18n.TranslateFunc
|
var T i18n.TranslateFunc
|
||||||
|
var TDefault i18n.TranslateFunc
|
||||||
var locales map[string]string = make(map[string]string)
|
var locales map[string]string = make(map[string]string)
|
||||||
var settings model.LocalizationSettings
|
var settings model.LocalizationSettings
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@ var settings model.LocalizationSettings
|
|||||||
func TranslationsPreInit() {
|
func TranslationsPreInit() {
|
||||||
InitTranslationsWithDir("i18n")
|
InitTranslationsWithDir("i18n")
|
||||||
T = TfuncWithFallback("en")
|
T = TfuncWithFallback("en")
|
||||||
|
TDefault = TfuncWithFallback("en")
|
||||||
}
|
}
|
||||||
|
|
||||||
func InitTranslations(localizationSettings model.LocalizationSettings) {
|
func InitTranslations(localizationSettings model.LocalizationSettings) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user