diff --git a/web/src/locales/en-US/alert.js b/web/src/locales/en-US/alert.js index 49f3f5c6..96ca3e42 100644 --- a/web/src/locales/en-US/alert.js +++ b/web/src/locales/en-US/alert.js @@ -1,8 +1,14 @@ export default { 'alert.button.acknowledge': 'Acknowledge', 'alert.button.create-monitor': 'Create monitor', + 'alert.button.update-monitor': 'Update monitor', 'alert.button.create-trigger': 'Create trigger', + 'alert.button.update-trigger': 'Update trigger', 'alert.button.add-destination': 'Add destination', + 'alert.button.create-destination': 'Create destination', + 'alert.button.update-destination': 'Update destination', + + 'alert.alerting': 'Alerting', 'alert.dashboard': 'Dashboard', 'alert.dashboard.alerts': 'Alerts', diff --git a/web/src/locales/zh-CN/alert.js b/web/src/locales/zh-CN/alert.js index d6a06257..0bd56d77 100644 --- a/web/src/locales/zh-CN/alert.js +++ b/web/src/locales/zh-CN/alert.js @@ -1,8 +1,14 @@ export default { 'alert.button.acknowledge': '确认', 'alert.button.create-monitor': '创建监控项', + 'alert.button.update-monitor': '更新监控项', 'alert.button.create-trigger': '创建触发器', + 'alert.button.update-trigger': '更新触发器', 'alert.button.add-destination': '添加渠道', + 'alert.button.create-destination': '创建渠道', + 'alert.button.update-destination': '更新渠道', + + 'alert.alerting': '告警管理', 'alert.dashboard': '告警概览', 'alert.dashboard.alerts': '告警管理', diff --git a/web/src/pages/Alerting/components/Breadcrumbs/Breadcrumbs.js b/web/src/pages/Alerting/components/Breadcrumbs/Breadcrumbs.js index fddeca60..76cb2a79 100644 --- a/web/src/pages/Alerting/components/Breadcrumbs/Breadcrumbs.js +++ b/web/src/pages/Alerting/components/Breadcrumbs/Breadcrumbs.js @@ -24,6 +24,7 @@ import { MONITOR_ACTIONS, TRIGGER_ACTIONS, } from '../../utils/constants'; +import { formatMessage } from 'umi/locale'; const propTypes = { history: PropTypes.object.isRequired, @@ -122,7 +123,7 @@ export async function getBreadcrumb(route, routeState, httpClient) { const destinationName = _.get(routeState, 'destinationToEdit.name', base); const destinationBreadcrumbs = [{ text: destinationName, href: `/destinations/${base}` }]; if (action === DESTINATION_ACTIONS.UPDATE_DESTINATION) { - destinationBreadcrumbs.push({ text: 'Update destination', href: '/' }); + destinationBreadcrumbs.push({ text: formatMessage({ id: 'alert.button.update-destination' }), href: '/' }); } return destinationBreadcrumbs; default: @@ -138,27 +139,27 @@ export async function getBreadcrumb(route, routeState, httpClient) { } const breadcrumbs = [{ text: monitorName, href: `/monitors/${base}` }]; if (action === MONITOR_ACTIONS.UPDATE_MONITOR) - breadcrumbs.push({ text: 'Update monitor', href: '/' }); + breadcrumbs.push({ text: formatMessage({ id: 'alert.button.update-monitor' }), href: '/' }); if (action === TRIGGER_ACTIONS.CREATE_TRIGGER) - breadcrumbs.push({ text: 'Create trigger', href: '/' }); + breadcrumbs.push({ text: formatMessage({ id: 'alert.button.create-trigger' }), href: '/' }); if (action === TRIGGER_ACTIONS.UPDATE_TRIGGER) - breadcrumbs.push({ text: 'Update trigger', href: '/' }); + breadcrumbs.push({ text: formatMessage({ id: 'alert.button.update-trigger' }), href: '/' }); return breadcrumbs; } } return { - '#': { text: 'Alerting', href: '/' }, - monitors: { text: 'Monitors', href: '/monitors' }, - dashboard: { text: 'Dashboard', href: '/dashboard' }, - destinations: { text: 'Destinations', href: '/destinations' }, + '#': { text: formatMessage({ id: 'alert.alerting' }), href: '/' }, + monitors: { text: formatMessage({ id: 'alert.monitor' }), href: '/monitors' }, + dashboard: { text: formatMessage({ id: 'alert.dashboard' }), href: '/dashboard' }, + destinations: { text: formatMessage({ id: 'alert.destination' }), href: '/destinations' }, 'create-monitor': [ - { text: 'Monitors', href: '/monitors' }, - { text: 'Create monitor', href: APP_PATH.CREATE_MONITOR }, + { text: formatMessage({ id: 'alert.monitor' }), href: '/monitors' }, + { text: formatMessage({ id: 'alert.button.create-monitor' }), href: APP_PATH.CREATE_MONITOR }, ], 'create-destination': [ - { text: 'Destinations', href: '/destinations' }, - { text: 'Create destination', href: APP_PATH.CREATE_DESTINATION }, + { text: formatMessage({ id: 'alert.destination' }), href: '/destinations' }, + { text: formatMessage({ id: 'alert.button.create-destination' }), href: APP_PATH.CREATE_DESTINATION }, ], }[base]; } diff --git a/web/src/pages/Alerting/pages/Monitors/components/MonitorEmptyPrompt/MonitorEmptyPrompt.js b/web/src/pages/Alerting/pages/Monitors/components/MonitorEmptyPrompt/MonitorEmptyPrompt.js index 808d309f..2e7f102b 100644 --- a/web/src/pages/Alerting/pages/Monitors/components/MonitorEmptyPrompt/MonitorEmptyPrompt.js +++ b/web/src/pages/Alerting/pages/Monitors/components/MonitorEmptyPrompt/MonitorEmptyPrompt.js @@ -22,7 +22,7 @@ import { formatMessage } from 'umi/locale'; const filterText = formatMessage({ id: 'alert.monitor.filter-text' }); const emptyMonitorText = formatMessage({ id: 'alert.monitor.empty-monitor-text' }); -const loadingText = formatMessage({ id: 'loading-monitors' }); +const loadingText = formatMessage({ id: 'alert.monitor.loading-monitors' }); const createMonitorButton = ( {formatMessage({ id: 'alert.button.create-monitor' })}