Update delete script dialog (#13768)

This commit is contained in:
Paul Bottein 2022-09-16 16:40:41 +02:00 committed by GitHub
parent a97dfbb51f
commit 5fcb219fcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 3 deletions

View File

@ -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,
});
}

View File

@ -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,
});
}

View File

@ -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.",