diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index d39e81a473..187b9d1687 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -697,10 +697,17 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { private async _deleteConfirm() { showConfirmationDialog(this, { - text: this.hass.localize("ui.panel.config.script.editor.delete_confirm"), + title: this.hass.localize( + "ui.panel.config.script.editor.delete_confirm_title" + ), + text: this.hass.localize( + "ui.panel.config.script.editor.delete_confirm_text", + { name: this._config?.alias } + ), confirmText: this.hass!.localize("ui.common.delete"), dismissText: this.hass!.localize("ui.common.cancel"), confirm: () => this._delete(), + destructive: true, }); } diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index da705e7ef4..b3b78028de 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -322,10 +322,18 @@ class HaScriptPicker extends LitElement { private async _deleteConfirm(script: any) { showConfirmationDialog(this, { - text: this.hass.localize("ui.panel.config.script.editor.delete_confirm"), + title: this.hass.localize( + "ui.panel.config.script.editor.delete_confirm_title" + ), + text: this.hass.localize( + "ui.panel.config.script.editor.delete_confirm_text", + "name", + { name: script.name } + ), confirmText: this.hass!.localize("ui.common.delete"), dismissText: this.hass!.localize("ui.common.cancel"), confirm: () => this._delete(script), + destructive: true, }); } diff --git a/src/translations/en.json b/src/translations/en.json index d0afe018f6..002316d2ad 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2313,7 +2313,8 @@ "load_error_not_duplicable": "Only scripts in scripts.yaml can be duplicated.", "load_error_not_deletable": "Only scripts in scripts.yaml can be deleted.", "load_error_unknown": "Error loading script ({err_no}).", - "delete_confirm": "Are you sure you want to delete this script?", + "delete_confirm_title": "Delete script?", + "delete_confirm_text": "{name} will be permanently deleted.", "save_script": "Save script", "sequence": "Sequence", "sequence_sentence": "The sequence of actions of this script.",