Add translations
This commit is contained in:
@@ -168,8 +168,10 @@ export const RulesGroup = React.memo(({ group, namespace, expandAll, viewMode }:
|
||||
if (isListView) {
|
||||
groupName = <RuleLocation namespace={decodeGrafanaNamespace(namespace).name} />;
|
||||
} else if (isUngroupedRuleGroup(group.name)) {
|
||||
const firstRuleName = group.rules[0]?.name ?? 'Unknown Rule';
|
||||
const groupDisplayName = `${firstRuleName} (Ungrouped)`;
|
||||
const firstRuleName = group.rules[0]?.name ?? t('alerting.rules-group.unknown-rule', 'Unknown Rule');
|
||||
const groupDisplayName = t('alerting.rules-group.ungrouped-suffix', '{{ruleName}} (Ungrouped)', {
|
||||
ruleName: firstRuleName,
|
||||
});
|
||||
groupName = <RuleLocation namespace={decodeGrafanaNamespace(namespace).name} group={groupDisplayName} />;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { groupBy, isEmpty } from 'lodash';
|
||||
import { useEffect, useMemo, useRef } from 'react';
|
||||
|
||||
import { t } from '@grafana/i18n';
|
||||
import { Icon, Stack, Text } from '@grafana/ui';
|
||||
import { GrafanaRuleGroupIdentifier, GrafanaRulesSourceSymbol } from 'app/types/unified-alerting';
|
||||
import { GrafanaPromRuleGroupDTO, PromRuleGroupDTO } from 'app/types/unified-alerting-dto';
|
||||
@@ -162,8 +163,10 @@ export function GrafanaRuleGroupListItem({ group, namespaceName }: GrafanaRuleGr
|
||||
|
||||
const detailsLink = groups.detailsPageLink(GRAFANA_RULES_SOURCE_NAME, group.folderUid, group.name);
|
||||
|
||||
const firstRuleName = group.rules[0]?.name ?? 'Unknown Rule';
|
||||
const groupDisplayName = isUngroupedRuleGroup(group.name) ? `${firstRuleName} (Ungrouped)` : group.name;
|
||||
const firstRuleName = group.rules[0]?.name ?? t('alerting.rules-group.unknown-rule', 'Unknown Rule');
|
||||
const groupDisplayName = isUngroupedRuleGroup(group.name)
|
||||
? t('alerting.rules-group.ungrouped-suffix', '{{ruleName}} (Ungrouped)', { ruleName: firstRuleName })
|
||||
: group.name;
|
||||
|
||||
return (
|
||||
<ListGroup
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { t } from '@grafana/i18n';
|
||||
import { Icon, Stack, TextLink, Tooltip } from '@grafana/ui';
|
||||
import { RulesSourceIdentifier } from 'app/types/unified-alerting';
|
||||
import { RulesSourceApplication } from 'app/types/unified-alerting-dto';
|
||||
@@ -17,7 +18,7 @@ interface RuleLocationProps {
|
||||
export function RuleLocation({ namespace, group, groupUrl, rulesSource, application }: RuleLocationProps) {
|
||||
const isGrafanaApp = application === 'grafana';
|
||||
const isDataSourceApp = !!rulesSource && !!application && !isGrafanaApp;
|
||||
const groupText = isUngroupedRuleGroup(group) ? 'Ungrouped' : group;
|
||||
const groupText = isUngroupedRuleGroup(group) ? t('alerting.rules-group.ungrouped', 'Ungrouped') : group;
|
||||
|
||||
return (
|
||||
<Stack direction="row" alignItems="center" gap={0.5}>
|
||||
|
||||
@@ -2656,7 +2656,10 @@
|
||||
"rules-group": {
|
||||
"deleting": "Deleting",
|
||||
"text-federated": "Federated",
|
||||
"text-provisioned": "Provisioned"
|
||||
"text-provisioned": "Provisioned",
|
||||
"ungrouped": "Ungrouped",
|
||||
"ungrouped-suffix": "{{ruleName}} (Ungrouped)",
|
||||
"unknown-rule": "Unknown Rule"
|
||||
},
|
||||
"search": {
|
||||
"property": {
|
||||
|
||||
Reference in New Issue
Block a user