From 159c4d100a54e53d303741077a6761a81cc7fee4 Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Sun, 15 Jun 2025 16:15:08 +0200 Subject: [PATCH] Add perform action with to translations (#25781) --- src/data/script_i18n.ts | 14 +++++++++++--- src/translations/en.json | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/data/script_i18n.ts b/src/data/script_i18n.ts index 56ba36ea0e..af1ebe2713 100644 --- a/src/data/script_i18n.ts +++ b/src/data/script_i18n.ts @@ -468,9 +468,17 @@ const tryDescribeAction = ( return localized; } const stateObj = hass.states[config.entity_id]; - return `${config.type || "Perform action with"} ${ - stateObj ? computeStateName(stateObj) : config.entity_id - }`; + if (config.type) { + return `${config.type} ${ + stateObj ? computeStateName(stateObj) : config.entity_id + }`; + } + return hass.localize( + `${actionTranslationBaseKey}.device_id.description.perform_device_action`, + { + device: stateObj ? computeStateName(stateObj) : config.entity_id, + } + ); } if (actionType === "sequence") { diff --git a/src/translations/en.json b/src/translations/en.json index 5ef4d2a0b5..71ad36376a 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -4286,7 +4286,8 @@ "action": "Action", "description": { "picker": "Do something on a device. Great way to start.", - "no_device": "Device action" + "no_device": "Device action", + "perform_device_action": "Perform action with {device}" } }, "repeat": {