diff --git a/.betterer.results b/.betterer.results index e5c01c52ec8..669d6e84e79 100644 --- a/.betterer.results +++ b/.betterer.results @@ -2073,17 +2073,6 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "13"], [0, 0, 0, "No untranslated strings. Wrap text with ", "14"] ], - "public/app/features/alerting/unified/components/rule-editor/GrafanaEvaluationBehavior.tsx:5381": [ - [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "7"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "8"] - ], "public/app/features/alerting/unified/components/rule-editor/NeedHelpInfo.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], diff --git a/public/app/features/alerting/unified/components/rule-editor/GrafanaEvaluationBehavior.tsx b/public/app/features/alerting/unified/components/rule-editor/GrafanaEvaluationBehavior.tsx index 939bd993524..93833664bb4 100644 --- a/public/app/features/alerting/unified/components/rule-editor/GrafanaEvaluationBehavior.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/GrafanaEvaluationBehavior.tsx @@ -1,9 +1,10 @@ import { css } from '@emotion/css'; import React, { useCallback, useEffect, useState } from 'react'; -import { RegisterOptions, useFormContext, Controller } from 'react-hook-form'; +import { Controller, RegisterOptions, useFormContext } from 'react-hook-form'; import { GrafanaTheme2, SelectableValue } from '@grafana/data'; import { Field, Icon, IconButton, Input, Label, Stack, Switch, Text, Tooltip, useStyles2 } from '@grafana/ui'; +import { Trans, t } from 'app/core/internationalization'; import { CombinedRuleGroup, CombinedRuleNamespace } from '../../../../../types/unified-alerting'; import { LogMessages, logInfo } from '../../Analytics'; @@ -46,14 +47,19 @@ const forValidationOptions = (evaluateEvery: string): RegisterOptions => ({ const millisEvery = parsePrometheusDuration(evaluateEvery); return millisFor >= millisEvery ? true - : 'Pending period must be greater than or equal to the evaluation interval.'; + : t( + 'alert-rule-form.evaluation-behaviour-for.validation', + 'Pending period must be greater than or equal to the evaluation interval.' + ); } catch (err) { // if we fail to parse "every", assume validation is successful, or the error messages // will overlap in the UI return true; } } catch (error) { - return error instanceof Error ? error.message : 'Failed to parse duration'; + return error instanceof Error + ? error.message + : t('alert-rule-form.evaluation-behaviour-for.error-parsing', 'Failed to parse duration'); } }, }); @@ -139,7 +145,9 @@ function FolderGroupAndEvaluationInterval({ {getValues('group') && getValues('evaluateEvery') && ( - All rules in the selected group are evaluated every {evaluateEvery}.{' '} + + All rules in the selected group are evaluated every {{ evaluateEvery }}. + {!isNewGroup && ( - Pending period + Pending period } className={styles.inlineField} @@ -211,7 +219,9 @@ function NeedHelpInfoForConfigureNoDataError() { return ( - Define the alert behavior when the evaluation fails or the query returns no data. + + Define the alert behavior when the evaluation fails or the query returns no data. + - Define how the alert rule is evaluated. + + Define how the alert rule is evaluated. + -

Evaluation groups are containers for evaluating alert and recording rules.

- An evaluation group defines an evaluation interval - how often a rule is evaluated. Alert rules within the - same evaluation group are evaluated over the same evaluation interval. + + Evaluation groups are containers for evaluating alert and recording rules. +

- Pending period specifies how long the threshold condition must be met before the alert starts firing. This - option helps prevent alerts from being triggered by temporary issues. + + An evaluation group defines an evaluation interval - how often a rule is evaluated. Alert rules within + the same evaluation group are evaluated over the same evaluation interval. + +

+

+ + Pending period specifies how long the threshold condition must be met before the alert starts firing. + This option helps prevent alerts from being triggered by temporary issues. +

} @@ -295,7 +315,7 @@ export function GrafanaEvaluationBehavior({ value={Boolean(isPaused)} />