Skip to content

Commit fc0c017

Browse files
authored
Ensure plurality in backfill count message with more than 1 run. (#51541)
* Ensure plurality in backfill count message with more than 1 run. * Simplify ternary conditional. * Refactor keys to use react-i18next plural support.
1 parent c4d7edb commit fc0c017

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

airflow-core/src/airflow/ui/src/components/DagActions/inlineMessage.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@ import type { TFunction } from "i18next";
2222
export const getInlineMessage = (isPendingDryRun: boolean, totalEntries: number, translate: TFunction) =>
2323
isPendingDryRun ? (
2424
<Skeleton height="20px" width="100px" />
25-
) : totalEntries > 1 ? (
26-
<Text color="fg.success" fontSize="sm">
27-
{translate("backfill.affectedOne")}
28-
</Text>
29-
) : totalEntries > 0 ? (
30-
<Text color="fg.success" fontSize="sm">
31-
{translate("backfill.affectedMultiple", { count: totalEntries })}
32-
</Text>
33-
) : (
25+
) : totalEntries === 0 ? (
3426
<Text color="fg.error" fontSize="sm" fontWeight="medium">
3527
{translate("backfill.affectedNone")}
3628
</Text>
29+
) : (
30+
<Text color="fg.success" fontSize="sm">
31+
{translate("backfill.affected", { count: totalEntries })}
32+
</Text>
3733
);

airflow-core/src/airflow/ui/src/i18n/locales/de/components.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"backfill": {
3-
"affectedMultiple": "{{count}} Läufe werden ausgelöst.",
3+
"affected_one": "1 Lauf wird ausgelöst.",
4+
"affected_other": "{{count}} Läufe werden ausgelöst.",
45
"affectedNone": "Keine Läufe entsprechend en Kriterien.",
5-
"affectedOne": "1 Lauf wird ausgelöst.",
66
"backwards": "Verarbeitung in Rückwärtiger Reihenfolge",
77
"dateRange": "Datumsbereich",
88
"dateRangeFrom": "Von",

airflow-core/src/airflow/ui/src/i18n/locales/en/components.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"backfill": {
3-
"affectedMultiple": "{{count}} runs will be triggered.",
3+
"affected_one": "1 run will be triggered.",
4+
"affected_other": "{{count}} runs will be triggered.",
45
"affectedNone": "No runs matching selected criteria.",
5-
"affectedOne": "1 run will be triggered.",
66
"backwards": "Run Backwards",
77
"dateRange": "Date Range",
88
"dateRangeFrom": "From",

airflow-core/src/airflow/ui/src/i18n/locales/pl/components.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"backfill": {
3-
"affectedMultiple": "Zostanie wywołanych {{count}} wykonań.",
3+
"affected_one": "Zostanie wywołane 1 wykonanie.",
4+
"affected_other": "Zostanie wywołanych {{count}} wykonań.",
45
"affectedNone": "Brak wykonań spełniających wybrane kryteria.",
5-
"affectedOne": "Zostanie wywołane 1 wykonanie.",
66
"backwards": "Uruchom wstecz",
77
"dateRange": "Zakres dat",
88
"dateRangeFrom": "Od",

0 commit comments

Comments
 (0)