From cfa522068cd0c5719981b59d5a9ae87b4598c191 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:42:43 -0700 Subject: [PATCH] Localize trigger condition and add list formatting (#18488) --- src/data/automation_i18n.ts | 12 ++++++++++-- src/translations/en.json | 5 ++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/data/automation_i18n.ts b/src/data/automation_i18n.ts index 7728bebabe..6e18baeef0 100644 --- a/src/data/automation_i18n.ts +++ b/src/data/automation_i18n.ts @@ -1090,8 +1090,16 @@ const tryDescribeCondition = ( }`; } - if (condition.condition === "trigger" && condition.id) { - return `When triggered by ${condition.id}`; + if (condition.condition === "trigger" && condition.id != null) { + return hass.localize( + `${conditionsTranslationBaseKey}.trigger.description.full`, + { + id: formatListWithOrs( + hass.locale, + ensureArray(condition.id).map((id) => id.toString()) + ), + } + ); } return ( diff --git a/src/translations/en.json b/src/translations/en.json index 5bd1055b2d..4120fee790 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2689,7 +2689,10 @@ "trigger": { "label": "Triggered by", "no_triggers": "No triggers have an ID set. You can set an ID using the trigger menu button.", - "id": "Trigger" + "id": "Trigger", + "description": { + "full": "When triggered by {id}" + } }, "zone": { "label": "[%key:ui::panel::config::automation::editor::triggers::type::zone::label%]",