chore: toasts translation refactoring

This commit is contained in:
Shishkevich D.
2025-05-09 10:46:29 +07:00
committed by GitHub
parent fe3b1c9b52
commit 1ddfe4aba3
20 changed files with 536 additions and 132 deletions

View File

@@ -42,11 +42,11 @@ func jsonMsgObj(c *gin.Context, msg string, obj any, err error) {
if err == nil {
m.Success = true
if msg != "" {
m.Msg = msg + " " + I18nWeb(c, "success")
m.Msg = msg
}
} else {
m.Success = false
m.Msg = msg + " " + I18nWeb(c, "fail") + ": " + err.Error()
m.Msg = msg + " (" + err.Error() + ")"
logger.Warning(msg+" "+I18nWeb(c, "fail")+": ", err)
}
c.JSON(http.StatusOK, m)