MCPcopy
hub / github.com/apache/answer / TrMsg

Method TrMsg

internal/base/handler/response.go:41–46  ·  view source on GitHub ↗

TrMsg translate the reason cause as a message

(lang i18n.Language)

Source from the content-addressed store, hash-verified

39
40// TrMsg translate the reason cause as a message
41func (r *RespBody) TrMsg(lang i18n.Language) *RespBody {
42 if len(r.Message) == 0 {
43 r.Message = translator.Tr(lang, r.Reason)
44 }
45 return r
46}
47
48// NewRespBody new response body
49func NewRespBody(code int, reason string) *RespBody {

Callers 1

HandleResponseFunction · 0.80

Calls 1

TrFunction · 0.92

Tested by

no test coverage detected