diff --git a/web/controller/inbound.go b/web/controller/inbound.go index 3cb3b6b6..9f51ab6b 100644 --- a/web/controller/inbound.go +++ b/web/controller/inbound.go @@ -49,7 +49,7 @@ func (a *InboundController) getInbounds(c *gin.Context) { user := session.GetLoginUser(c) inbounds, err := a.inboundService.GetInbounds(user.Id) if err != nil { - jsonMsg(c, "获取", err) + jsonMsg(c, I18n(c , "pages.inbounds.toasts.obtain"), err) return } jsonObj(c, inbounds, nil) @@ -59,7 +59,7 @@ func (a *InboundController) addInbound(c *gin.Context) { inbound := &model.Inbound{} err := c.ShouldBind(inbound) if err != nil { - jsonMsg(c, "添加", err) + jsonMsg(c, I18n(c , "pages.inbounds.addTo"), err) return } user := session.GetLoginUser(c) @@ -67,7 +67,7 @@ func (a *InboundController) addInbound(c *gin.Context) { inbound.Enable = true inbound.Tag = fmt.Sprintf("inbound-%v", inbound.Port) err = a.inboundService.AddInbound(inbound) - jsonMsg(c, "添加", err) + jsonMsg(c, I18n(c , "pages.inbounds.addTo"), err) if err == nil { a.xrayService.SetToNeedRestart() } @@ -76,11 +76,11 @@ func (a *InboundController) addInbound(c *gin.Context) { func (a *InboundController) delInbound(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { - jsonMsg(c, "删除", err) + jsonMsg(c, I18n(c , "delete"), err) return } err = a.inboundService.DelInbound(id) - jsonMsg(c, "删除", err) + jsonMsg(c, I18n(c , "delete"), err) if err == nil { a.xrayService.SetToNeedRestart() } @@ -89,7 +89,7 @@ func (a *InboundController) delInbound(c *gin.Context) { func (a *InboundController) updateInbound(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { - jsonMsg(c, "修改", err) + jsonMsg(c, I18n(c , "pages.inbounds.revise"), err) return } inbound := &model.Inbound{ @@ -97,11 +97,11 @@ func (a *InboundController) updateInbound(c *gin.Context) { } err = c.ShouldBind(inbound) if err != nil { - jsonMsg(c, "修改", err) + jsonMsg(c, I18n(c , "pages.inbounds.revise"), err) return } err = a.inboundService.UpdateInbound(inbound) - jsonMsg(c, "修改", err) + jsonMsg(c, I18n(c , "pages.inbounds.revise"), err) if err == nil { a.xrayService.SetToNeedRestart() } diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index f6fbfa80..06d40756 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -123,6 +123,9 @@ "keyPath" = "key file path" "keyContent" = "key content" +[pages.inbounds.toasts] +"obtain" = "Obtain" + [pages.setting] "title" = "Setting" diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml index 8196ae4b..a4e52f5b 100644 --- a/web/translation/translate.zh_Hans.toml +++ b/web/translation/translate.zh_Hans.toml @@ -120,7 +120,8 @@ "keyPath" = "密钥文件路径" "keyContent" = "密钥内容" - +[pages.inbounds.toasts] +"obtain" = "获取"