From 611678c88ce334ab1bdd697030463786d0ef62c3 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 30 Mar 2026 15:11:26 +0200 Subject: [PATCH] Remove domain prefix from actions --- src/data/script_i18n.ts | 8 +------- .../config/automation/add-automation-element-dialog.ts | 9 ++++----- .../automation/sidebar/ha-automation-sidebar-action.ts | 6 ++---- src/translations/en.json | 3 +-- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/data/script_i18n.ts b/src/data/script_i18n.ts index b9c711f6f6..be0bbba426 100644 --- a/src/data/script_i18n.ts +++ b/src/data/script_i18n.ts @@ -114,13 +114,7 @@ const tryDescribeAction = ( ) || hass.services[domain]?.[serviceName]?.name; if (config.metadata) { - return hass.localize( - `${actionTranslationBaseKey}.service.description.service_name_no_targets`, - { - domain: domainToName(hass.localize, domain), - name: service || config.action, - } - ); + return service || config.action; } return hass.localize( diff --git a/src/panels/config/automation/add-automation-element-dialog.ts b/src/panels/config/automation/add-automation-element-dialog.ts index 5d363840a9..00d847b1f9 100644 --- a/src/panels/config/automation/add-automation-element-dialog.ts +++ b/src/panels/config/automation/add-automation-element-dialog.ts @@ -1429,16 +1429,15 @@ class DialogAddAutomationElement > `, key: `${DYNAMIC_PREFIX}${dmn}.${service}`, - name: `${domain ? "" : `${domainToName(localize, dmn)}: `}${ - this.hass.localize( + name: + localize( `component.${dmn}.services.${service}.name`, this.hass.services[dmn][service].description_placeholders ) || services[dmn][service]?.name || - service - }`, + service, description: - this.hass.localize( + localize( `component.${dmn}.services.${service}.description`, this.hass.services[dmn][service].description_placeholders ) || diff --git a/src/panels/config/automation/sidebar/ha-automation-sidebar-action.ts b/src/panels/config/automation/sidebar/ha-automation-sidebar-action.ts index ce2a650d06..cb1c22f2fd 100644 --- a/src/panels/config/automation/sidebar/ha-automation-sidebar-action.ts +++ b/src/panels/config/automation/sidebar/ha-automation-sidebar-action.ts @@ -24,7 +24,6 @@ import type { HaDropdownSelectEvent } from "../../../../components/ha-dropdown"; import "../../../../components/ha-dropdown-item"; import { ACTION_BUILDING_BLOCKS } from "../../../../data/action"; import type { ActionSidebarConfig } from "../../../../data/automation"; -import { domainToName } from "../../../../data/integration"; import type { NonConditionAction, RepeatAction, @@ -102,14 +101,13 @@ export default class HaAutomationSidebarAction extends LitElement { 2 ); - title = `${domainToName(this.hass.localize, domain)}: ${ + title = this.hass.localize( `component.${domain}.services.${service}.name`, this.hass.services[domain]?.[service]?.description_placeholders ) || this.hass.services[domain]?.[service]?.name || - title - }`; + title; } const description = isBuildingBlock diff --git a/src/translations/en.json b/src/translations/en.json index d95cedd9ee..831e972881 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -5452,10 +5452,9 @@ "picker": "Previously known as call service.", "service_based_on_template": "Perform an action based on a template on {targets}", "service_based_on_name": "Perform action ''{name}'' on {targets}", - "service_name": "{domain} ''{name}'' on {targets}", + "service_name": "{name} on {targets}", "service_based_on_template_no_targets": "Perform an action based on a template", "service_based_on_name_no_targets": "Perform action ''{name}''", - "service_name_no_targets": "{domain} ''{name}''", "service": "Perform an action", "target_template": "templated {name}", "target_every_entity": "every entity",