update: util controller translate

This commit is contained in:
Mohammad Foroughi
2022-10-31 13:26:50 +03:30
parent 114af22074
commit 2b5fd5cab8
3 changed files with 7 additions and 3 deletions

View File

@@ -46,12 +46,12 @@ func jsonMsgObj(c *gin.Context, msg string, obj interface{}, err error) {
if err == nil {
m.Success = true
if msg != "" {
m.Msg = msg + "成功"
m.Msg = msg + I18n(c , "success")
}
} else {
m.Success = false
m.Msg = msg + "失败: " + err.Error()
logger.Warning(msg+"失败: ", err)
m.Msg = msg + I18n(c , "fail") + ": " + err.Error()
logger.Warning(msg + I18n(c , "fail") + ": ", err)
}
c.JSON(http.StatusOK, m)
}

View File

@@ -37,6 +37,8 @@
"additional" = "additional"
"monitor" = "monitor"
"certificate" = "certificat"
"fail" = "fail"
"success" = "success"

View File

@@ -37,6 +37,8 @@
"additional" = "额外"
"monitor" = "监听"
"certificate" = "证书"
"fail" : "失败"
"success" = "成功"
[menu]
"dashboard" = "系统状态"