Skip to content

Commit

Permalink
fix: i18n of alert list (#4304) (#4310)
Browse files Browse the repository at this point in the history
* fix: i18n

* fix: i18n

* fix: i18n

Co-authored-by: 郭刚平 <[email protected]>
  • Loading branch information
erda-bot and snakorse authored Mar 9, 2022
1 parent 6a73078 commit f85c046
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions conf/msp/i18n/cp/msp-alert-event-list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
zh:
"alert strategy": "告警策略"
"level": "级别"
"status": "状态"
"event source": "事件来源"
"last trigger time": "最后触发时间"
"select alert strategy": "选择告警策略"
"select level": "选择级别"
"select status": "选择状态"
"select event source": "选择事件来源"
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@ func (p *provider) RegisterFilterItemDeleteOp(opData filter.OpFilterItemDelete)

func (p *provider) getConfigurableFilterOptions(sdk *cptype.SDK, inParams *common.InParams) []interface{} {
alerts, _ := p.getAlerts(sdk.Ctx, inParams)
alertSelectCondition := model.NewSelectCondition("alertIds", "告警策略", common.IdNameValuesToSelectOptions(alerts)).WithPlaceHolder("选择告警策略")
alertSelectCondition := model.NewSelectCondition("alertIds", sdk.I18n("alert strategy"), common.IdNameValuesToSelectOptions(alerts)).WithPlaceHolder(sdk.I18n("select alert strategy"))

alertLevels := p.getAlertLevels(sdk, inParams)
alertLevelSelectCondition := model.NewSelectCondition("alertLevels", "级别", common.IdNameValuesToSelectOptions(alertLevels)).WithPlaceHolder("选择级别")
alertLevelSelectCondition := model.NewSelectCondition("alertLevels", sdk.I18n("level"), common.IdNameValuesToSelectOptions(alertLevels)).WithPlaceHolder(sdk.I18n("select level"))

alertStates := p.getAlertStates(sdk, inParams)
alertStateSelectCondition := model.NewSelectCondition("alertStates", "状态", common.IdNameValuesToSelectOptions(alertStates)).WithPlaceHolder("选择状态")
alertStateSelectCondition := model.NewSelectCondition("alertStates", sdk.I18n("status"), common.IdNameValuesToSelectOptions(alertStates)).WithPlaceHolder(sdk.I18n("select status"))

alertSources := p.getAlertSources(sdk, inParams)
alertSourceSelectCondition := model.NewSelectCondition("alertSources", "事件来源", common.IdNameValuesToSelectOptions(alertSources)).WithPlaceHolder("选择事件来源")
alertSourceSelectCondition := model.NewSelectCondition("alertSources", sdk.I18n("event source"), common.IdNameValuesToSelectOptions(alertSources)).WithPlaceHolder(sdk.I18n("select event source"))

alertTriggerTimeRangeCondition := model.NewDateRangeCondition("lastTriggerTime", "最后触发时间")
alertTriggerTimeRangeCondition := model.NewDateRangeCondition("lastTriggerTime", sdk.I18n("last trigger time"))
return []interface{}{alertSelectCondition, alertLevelSelectCondition, alertStateSelectCondition, alertSourceSelectCondition, alertTriggerTimeRangeCondition}
}

Expand Down

0 comments on commit f85c046

Please sign in to comment.