From c790bdff06cc174b5d9f7b5bd67ab25f7147c4b9 Mon Sep 17 00:00:00 2001 From: rodrigopk Date: Tue, 6 Jan 2026 15:55:08 -0500 Subject: [PATCH] Add translations --- .../alerting/unified/components/rules/RulesGroup.tsx | 6 ++++-- .../alerting/unified/rule-list/PaginatedGrafanaLoader.tsx | 7 +++++-- .../alerting/unified/rule-list/components/RuleLocation.tsx | 3 ++- public/locales/en-US/grafana.json | 5 ++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/public/app/features/alerting/unified/components/rules/RulesGroup.tsx b/public/app/features/alerting/unified/components/rules/RulesGroup.tsx index aeead7db121..421506e6dc3 100644 --- a/public/app/features/alerting/unified/components/rules/RulesGroup.tsx +++ b/public/app/features/alerting/unified/components/rules/RulesGroup.tsx @@ -168,8 +168,10 @@ export const RulesGroup = React.memo(({ group, namespace, expandAll, viewMode }: if (isListView) { groupName = ; } 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 = ; } diff --git a/public/app/features/alerting/unified/rule-list/PaginatedGrafanaLoader.tsx b/public/app/features/alerting/unified/rule-list/PaginatedGrafanaLoader.tsx index 8bb360ad6d2..6d26a43bbfd 100644 --- a/public/app/features/alerting/unified/rule-list/PaginatedGrafanaLoader.tsx +++ b/public/app/features/alerting/unified/rule-list/PaginatedGrafanaLoader.tsx @@ -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 ( diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index cc056e38526..290706420a3 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -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": {