From f85c04644bdab25a1894e05ad88210bfa26e0432 Mon Sep 17 00:00:00 2001 From: erda-bot <81558540+erda-bot@users.noreply.github.com> Date: Wed, 9 Mar 2022 14:39:21 +0800 Subject: [PATCH] fix: i18n of alert list (#4304) (#4310) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: i18n * fix: i18n * fix: i18n Co-authored-by: 郭刚平 <512979011@qq.com> --- conf/msp/i18n/cp/msp-alert-event-list.yaml | 10 ++++++++++ .../configurableFilter/provider.go | 10 +++++----- 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 conf/msp/i18n/cp/msp-alert-event-list.yaml diff --git a/conf/msp/i18n/cp/msp-alert-event-list.yaml b/conf/msp/i18n/cp/msp-alert-event-list.yaml new file mode 100644 index 00000000000..b55d2c96ba5 --- /dev/null +++ b/conf/msp/i18n/cp/msp-alert-event-list.yaml @@ -0,0 +1,10 @@ +zh: + "alert strategy": "告警策略" + "level": "级别" + "status": "状态" + "event source": "事件来源" + "last trigger time": "最后触发时间" + "select alert strategy": "选择告警策略" + "select level": "选择级别" + "select status": "选择状态" + "select event source": "选择事件来源" \ No newline at end of file diff --git a/modules/msp/apm/alert/components/msp-alert-event-list/configurableFilter/provider.go b/modules/msp/apm/alert/components/msp-alert-event-list/configurableFilter/provider.go index 29ba1281254..33dffe87121 100644 --- a/modules/msp/apm/alert/components/msp-alert-event-list/configurableFilter/provider.go +++ b/modules/msp/apm/alert/components/msp-alert-event-list/configurableFilter/provider.go @@ -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} }