From c80c06857d2bca75dd8239acce770dac15d12d3f Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Tue, 3 Nov 2020 01:24:51 +0100 Subject: [PATCH 1/4] Convert misleading "cancel" dialogs to yes/no --- .../lovelace/resources/ha-config-lovelace-resources.ts | 2 ++ src/panels/lovelace/hui-root.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts index 5ae5003d5acd..6a837e35b571 100644 --- a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts +++ b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts @@ -189,6 +189,8 @@ export class HaConfigLovelaceRescources extends LitElement { text: this.hass!.localize( "ui.panel.config.lovelace.resources.refresh_body" ), + confirmText: this.hass.localize("ui.common.yes"), + dismissText: this.hass.localize("ui.common.no"), confirm: () => location.reload(), }); return true; diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 77f0ca41990e..102134a558ba 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -610,6 +610,8 @@ class HUIRoot extends LitElement { text: this.hass!.localize( "ui.panel.lovelace.reload_resources.refresh_body" ), + confirmText: this.hass.localize("ui.common.yes"), + dismissText: this.hass.localize("ui.common.no"), confirm: () => location.reload(), }); } @@ -805,7 +807,8 @@ class HUIRoot extends LitElement { margin-left: max(env(safe-area-inset-left), 12px); margin-right: env(safe-area-inset-right); } - ha-tabs, paper-tabs { + ha-tabs, + paper-tabs { --paper-tabs-selection-bar-color: var(--text-primary-color, #fff); text-transform: uppercase; } From 675ea372756d4064b57c1ac2f42184dbd1c3554b Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Fri, 6 Nov 2020 23:33:29 +0100 Subject: [PATCH 2/4] Changes from review + make "URL" capitalization consistent --- .../resources/ha-config-lovelace-resources.ts | 2 +- src/panels/lovelace/ha-panel-lovelace.ts | 2 +- src/panels/lovelace/hui-root.ts | 8 ++--- src/translations/en.json | 29 +++++++++---------- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts index 6a837e35b571..4be4f36881ca 100644 --- a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts +++ b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts @@ -189,7 +189,7 @@ export class HaConfigLovelaceRescources extends LitElement { text: this.hass!.localize( "ui.panel.config.lovelace.resources.refresh_body" ), - confirmText: this.hass.localize("ui.common.yes"), + confirmText: this.hass.localize("ui.common.refresh"), dismissText: this.hass.localize("ui.common.no"), confirm: () => location.reload(), }); diff --git a/src/panels/lovelace/ha-panel-lovelace.ts b/src/panels/lovelace/ha-panel-lovelace.ts index e7baf8a427af..a955e5905695 100644 --- a/src/panels/lovelace/ha-panel-lovelace.ts +++ b/src/panels/lovelace/ha-panel-lovelace.ts @@ -184,7 +184,7 @@ class LovelacePanel extends LitElement { message: this.hass!.localize("ui.panel.lovelace.changed_toast.message"), action: { action: () => this._fetchConfig(false), - text: this.hass!.localize("ui.panel.lovelace.changed_toast.refresh"), + text: this.hass!.localize("ui.common.refresh"), }, duration: 0, dismissable: false, diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 102134a558ba..b8516170e376 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -284,15 +284,13 @@ class HUIRoot extends LitElement { ? html` ${this.hass!.localize( - "ui.panel.lovelace.menu.refresh" - )}${this.hass!.localize("ui.common.refresh")} location.reload(), }); diff --git a/src/translations/en.json b/src/translations/en.json index 6323e70856ba..65037b6c58a2 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -271,6 +271,7 @@ "delete": "Delete", "close": "Close", "next": "Next", + "back": "Back", "undo": "Undo", "save": "Save", "yes": "Yes", @@ -279,7 +280,7 @@ "overflow_menu": "Overflow menu", "successfully_saved": "Successfully saved", "successfully_deleted": "Successfully deleted", - "back": "Back", + "error_required": "Required", "copied": "Copied" }, @@ -445,7 +446,7 @@ "season": "Season", "track": "Track", "tv_show": "TV Show", - "url": "Url", + "url": "URL", "video": "Video" } } @@ -918,7 +919,7 @@ "icon": "Icon", "title": "Title", "title_required": "Title is required.", - "url": "Url", + "url": "URL", "url_error_msg": "The URL should contain a - and cannot contain spaces or special characters, except for _ and -", "require_admin": "Admin only", "delete": "Delete", @@ -938,7 +939,7 @@ }, "picker": { "headers": { - "url": "Url", + "url": "URL", "type": "Type" }, "no_resources": "No resources", @@ -946,15 +947,15 @@ }, "confirm_delete": "Are you sure you want to delete this resource?", "refresh_header": "Do you want to refresh?", - "refresh_body": "You have to refresh the page to complete the removal, do you want to refresh now?", + "refresh_body": "You have to refresh the page to complete the removal. Do you want to refresh now?", "cant_edit_yaml": "You are using Lovelace in YAML mode, therefore you cannot manage your resources through the UI. Manage them in configuration.yaml.", "detail": { "new_resource": "Add new resource", "dismiss": "Close", "warning_header": "Be cautious!", "warning_text": "Adding resources can be dangerous, make sure you know the source of the resource and trust them. Bad resources could seriously harm your system.", - "url": "Url", - "url_error_msg": "Url is a required field", + "url": "URL", + "url_error_msg": "URL is a required field", "type": "Resource type", "delete": "Delete", "update": "Update", @@ -1600,7 +1601,7 @@ }, "dialog_cloudhook": { "webhook_for": "Webhook for {name}", - "available_at": "The webhook is available at the following url:", + "available_at": "The webhook is available at the following URL:", "managed_by_integration": "This webhook is managed by an integration and cannot be disabled.", "info_disable_webhook": "If you no longer want to use this webhook, you can", "link_disable_webhook": "disable it", @@ -2293,7 +2294,6 @@ "menu": { "configure_ui": "Edit Dashboard", "help": "Help", - "refresh": "Refresh", "start_conversation": "Start conversation", "reload_resources": "Reload resources", "exit_edit_mode": "Exit UI edit mode", @@ -2301,7 +2301,7 @@ }, "reload_resources": { "refresh_header": "Do you want to refresh?", - "refresh_body": "You have to refresh the page to complete the reload, do you want to refresh now?" + "refresh_body": "You have to refresh the page to complete the reload. Do you want to refresh now?" }, "editor": { "header": "Edit UI", @@ -2400,7 +2400,7 @@ }, "action-editor": { "navigation_path": "Navigation Path", - "url_path": "Url Path", + "url_path": "URL Path", "editor_service_data": "Service data can only be entered in the code editor", "actions": { "default_action": "Default Action", @@ -2408,7 +2408,7 @@ "more-info": "More Info", "toggle": "Toggle", "navigate": "Navigate", - "url": "Url", + "url": "URL", "none": "No Action" } }, @@ -2549,7 +2549,7 @@ "theme": "Theme", "no_theme": "No theme", "unit": "Unit", - "url": "Url", + "url": "URL", "state": "State", "secondary_info_attribute": "Secondary Info Attribute", "search": "Search", @@ -2642,8 +2642,7 @@ "starting": "Home Assistant is starting, not everything may be available yet" }, "changed_toast": { - "message": "The Lovelace UI configuration for this dashboard was updated, refresh to see changes?", - "refresh": "Refresh" + "message": "The Lovelace UI configuration for this dashboard was updated. Refresh to see changes?" }, "reload_lovelace": "Reload UI" }, From 674a928ead8f97e595c3702e3b98e97197d808c3 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Sat, 7 Nov 2020 10:19:03 +0100 Subject: [PATCH 3/4] Overhaul most dialog buttons to be clearer + missing translations --- src/dialogs/more-info/ha-more-info-dialog.ts | 4 ++-- .../config/areas/ha-config-area-page.ts | 4 ++-- .../action/ha-automation-action-row.ts | 4 ++-- .../condition/ha-automation-condition-row.ts | 4 ++-- .../config/automation/ha-automation-editor.ts | 12 +++++----- .../trigger/ha-automation-trigger-row.ts | 4 ++-- .../dialog-manage-cloudhook.ts | 4 ++-- .../config/devices/ha-config-device-page.ts | 2 +- .../config/entities/ha-config-entities.ts | 12 +++++----- .../resources/ha-config-lovelace-resources.ts | 2 +- src/panels/config/person/ha-config-person.ts | 10 ++++---- src/panels/config/scene/ha-scene-editor.ts | 8 +++---- src/panels/config/script/ha-script-editor.ts | 8 +++---- src/panels/config/tags/ha-config-tags.ts | 12 ++++++---- src/panels/config/users/ha-config-users.ts | 4 ++-- src/panels/config/zone/ha-config-zone.ts | 7 +++--- .../card-editor/hui-dialog-edit-card.ts | 4 ++-- src/panels/lovelace/hui-editor.ts | 8 +++---- src/panels/lovelace/hui-root.ts | 2 +- src/translations/en.json | 23 +++++++++++++------ 20 files changed, 75 insertions(+), 63 deletions(-) diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 10a4b1f15bc9..ae3b35680958 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -304,8 +304,8 @@ export class MoreInfoDialog extends LitElement { text: this.hass.localize( "ui.dialogs.more_info_control.restored.confirm_remove_text" ), - confirmText: this.hass.localize("ui.common.yes"), - dismissText: this.hass.localize("ui.common.no"), + confirmText: this.hass.localize("ui.common.remove"), + dismissText: this.hass.localize("ui.common.cancel"), confirm: () => { removeEntityRegistryEntry(this.hass, entityId); }, diff --git a/src/panels/config/areas/ha-config-area-page.ts b/src/panels/config/areas/ha-config-area-page.ts index ec0085aacdb6..d03ebebbbad5 100644 --- a/src/panels/config/areas/ha-config-area-page.ts +++ b/src/panels/config/areas/ha-config-area-page.ts @@ -312,8 +312,8 @@ class HaConfigAreaPage extends LitElement { text: this.hass.localize( "ui.panel.config.areas.delete.confirmation_text" ), - dismissText: this.hass.localize("ui.common.no"), - confirmText: this.hass.localize("ui.common.yes"), + dismissText: this.hass.localize("ui.common.cancel"), + confirmText: this.hass.localize("ui.common.delete"), })) ) { return false; diff --git a/src/panels/config/automation/action/ha-automation-action-row.ts b/src/panels/config/automation/action/ha-automation-action-row.ts index e4cfebe8c7df..4cc20c8c0441 100644 --- a/src/panels/config/automation/action/ha-automation-action-row.ts +++ b/src/panels/config/automation/action/ha-automation-action-row.ts @@ -276,8 +276,8 @@ export default class HaAutomationActionRow extends LitElement { text: this.hass.localize( "ui.panel.config.automation.editor.actions.delete_confirm" ), - dismissText: this.hass.localize("ui.common.no"), - confirmText: this.hass.localize("ui.common.yes"), + dismissText: this.hass.localize("ui.common.cancel"), + confirmText: this.hass.localize("ui.common.delete"), confirm: () => { fireEvent(this, "value-changed", { value: null }); }, diff --git a/src/panels/config/automation/condition/ha-automation-condition-row.ts b/src/panels/config/automation/condition/ha-automation-condition-row.ts index 1c9b1552a3d1..6b824a60fcc4 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-row.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-row.ts @@ -123,8 +123,8 @@ export default class HaAutomationConditionRow extends LitElement { text: this.hass.localize( "ui.panel.config.automation.editor.conditions.delete_confirm" ), - dismissText: this.hass.localize("ui.common.no"), - confirmText: this.hass.localize("ui.common.yes"), + dismissText: this.hass.localize("ui.common.cancel"), + confirmText: this.hass.localize("ui.common.delete"), confirm: () => { fireEvent(this, "value-changed", { value: null }); }, diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index 9552fd5d9f5a..ebddba4384c1 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -650,8 +650,8 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { text: this.hass!.localize( "ui.panel.config.automation.editor.unsaved_confirm" ), - confirmText: this.hass!.localize("ui.common.yes"), - dismissText: this.hass!.localize("ui.common.no"), + confirmText: this.hass!.localize("ui.common.leave"), + dismissText: this.hass!.localize("ui.common.stay"), confirm: () => history.back(), }); } else { @@ -666,8 +666,8 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { text: this.hass!.localize( "ui.panel.config.automation.editor.unsaved_confirm" ), - confirmText: this.hass!.localize("ui.common.yes"), - dismissText: this.hass!.localize("ui.common.no"), + confirmText: this.hass!.localize("ui.common.leave"), + dismissText: this.hass!.localize("ui.common.stay"), })) ) { return; @@ -689,8 +689,8 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { text: this.hass.localize( "ui.panel.config.automation.picker.delete_confirm" ), - confirmText: this.hass!.localize("ui.common.yes"), - dismissText: this.hass!.localize("ui.common.no"), + confirmText: this.hass!.localize("ui.common.delete"), + dismissText: this.hass!.localize("ui.common.cancel"), confirm: () => this._delete(), }); } diff --git a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts index 687889c6348e..944c57044df8 100644 --- a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts +++ b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts @@ -196,8 +196,8 @@ export default class HaAutomationTriggerRow extends LitElement { text: this.hass.localize( "ui.panel.config.automation.editor.triggers.delete_confirm" ), - dismissText: this.hass.localize("ui.common.no"), - confirmText: this.hass.localize("ui.common.yes"), + dismissText: this.hass.localize("ui.common.cancel"), + confirmText: this.hass.localize("ui.common.delete"), confirm: () => { fireEvent(this, "value-changed", { value: null }); }, diff --git a/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts b/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts index 1561ed74209b..9357e45c757f 100644 --- a/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts +++ b/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts @@ -119,8 +119,8 @@ export class DialogManageCloudhook extends LitElement { text: this.hass!.localize( "ui.panel.config.cloud.dialog_cloudhook.confirm_disable" ), - dismissText: this.hass!.localize("ui.common.no"), - confirmText: this.hass!.localize("ui.common.yes"), + dismissText: this.hass!.localize("ui.common.cancel"), + confirmText: this.hass!.localize("ui.common.disable"), confirm: () => { this._params!.disableHook(); this._closeDialog(); diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts index 15a471bd6c1a..dfe12869051a 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -587,7 +587,7 @@ export class HaConfigDevicePage extends LitElement { text: this.hass.localize( "ui.panel.config.devices.confirm_rename_entity_ids_warning" ), - confirmText: this.hass.localize("ui.common.yes"), + confirmText: this.hass.localize("ui.common.rename"), dismissText: this.hass.localize("ui.common.no"), warning: true, })); diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index 85ffc4a26a16..7883f47cdc1b 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -695,8 +695,8 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { text: this.hass.localize( "ui.panel.config.entities.picker.enable_selected.confirm_text" ), - confirmText: this.hass.localize("ui.common.yes"), - dismissText: this.hass.localize("ui.common.no"), + confirmText: this.hass.localize("ui.common.enable"), + dismissText: this.hass.localize("ui.common.cancel"), confirm: () => { this._selectedEntities.forEach((entity) => updateEntityRegistryEntry(this.hass, entity, { @@ -718,8 +718,8 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { text: this.hass.localize( "ui.panel.config.entities.picker.disable_selected.confirm_text" ), - confirmText: this.hass.localize("ui.common.yes"), - dismissText: this.hass.localize("ui.common.no"), + confirmText: this.hass.localize("ui.common.disable"), + dismissText: this.hass.localize("ui.common.cancel"), confirm: () => { this._selectedEntities.forEach((entity) => updateEntityRegistryEntry(this.hass, entity, { @@ -758,8 +758,8 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { "selected", this._selectedEntities.length ), - confirmText: this.hass.localize("ui.common.yes"), - dismissText: this.hass.localize("ui.common.no"), + confirmText: this.hass.localize("ui.common.remove"), + dismissText: this.hass.localize("ui.common.cancel"), confirm: () => { removeableEntities.forEach((entity) => removeEntityRegistryEntry(this.hass, entity) diff --git a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts index 4be4f36881ca..e528ca6a5f05 100644 --- a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts +++ b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts @@ -190,7 +190,7 @@ export class HaConfigLovelaceRescources extends LitElement { "ui.panel.config.lovelace.resources.refresh_body" ), confirmText: this.hass.localize("ui.common.refresh"), - dismissText: this.hass.localize("ui.common.no"), + dismissText: this.hass.localize("ui.common.not_now"), confirm: () => location.reload(), }); return true; diff --git a/src/panels/config/person/ha-config-person.ts b/src/panels/config/person/ha-config-person.ts index d7403b341a9c..746e221981f5 100644 --- a/src/panels/config/person/ha-config-person.ts +++ b/src/panels/config/person/ha-config-person.ts @@ -245,10 +245,12 @@ class HaConfigPerson extends LitElement { removeEntry: async () => { if ( !(await showConfirmationDialog(this, { - title: this.hass!.localize("ui.panel.config.person.confirm_delete"), - text: this.hass!.localize("ui.panel.config.person.confirm_delete2"), - dismissText: this.hass!.localize("ui.common.no"), - confirmText: this.hass!.localize("ui.common.yes"), + title: this.hass!.localize( + "ui.panel.config.person.confirm_delete_title" + ), + text: this.hass!.localize("ui.panel.config.person.confirm_delete"), + dismissText: this.hass!.localize("ui.common.cancel"), + confirmText: this.hass!.localize("ui.common.delete"), })) ) { return false; diff --git a/src/panels/config/scene/ha-scene-editor.ts b/src/panels/config/scene/ha-scene-editor.ts index 22bbba718d99..e7605233a4e3 100644 --- a/src/panels/config/scene/ha-scene-editor.ts +++ b/src/panels/config/scene/ha-scene-editor.ts @@ -645,8 +645,8 @@ export class HaSceneEditor extends SubscribeMixin( text: this.hass!.localize( "ui.panel.config.scene.editor.unsaved_confirm" ), - confirmText: this.hass!.localize("ui.common.yes"), - dismissText: this.hass!.localize("ui.common.no"), + confirmText: this.hass!.localize("ui.common.leave"), + dismissText: this.hass!.localize("ui.common.stay"), confirm: () => this._goBack(), }); } else { @@ -662,8 +662,8 @@ export class HaSceneEditor extends SubscribeMixin( private _deleteTapped(): void { showConfirmationDialog(this, { text: this.hass!.localize("ui.panel.config.scene.picker.delete_confirm"), - confirmText: this.hass!.localize("ui.common.yes"), - dismissText: this.hass!.localize("ui.common.no"), + confirmText: this.hass!.localize("ui.common.delete"), + dismissText: this.hass!.localize("ui.common.cancel"), confirm: () => this._delete(), }); } diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index 63dc5bfcb3ab..de0fa17a5c61 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -541,8 +541,8 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { text: this.hass!.localize( "ui.panel.config.common.editor.confirm_unsaved" ), - confirmText: this.hass!.localize("ui.common.yes"), - dismissText: this.hass!.localize("ui.common.no"), + confirmText: this.hass!.localize("ui.common.leave"), + dismissText: this.hass!.localize("ui.common.stay"), confirm: () => history.back(), }); } else { @@ -553,8 +553,8 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { private async _deleteConfirm() { showConfirmationDialog(this, { text: this.hass.localize("ui.panel.config.script.editor.delete_confirm"), - confirmText: this.hass!.localize("ui.common.yes"), - dismissText: this.hass!.localize("ui.common.no"), + confirmText: this.hass!.localize("ui.common.delete"), + dismissText: this.hass!.localize("ui.common.cancel"), confirm: () => this._delete(), }); } diff --git a/src/panels/config/tags/ha-config-tags.ts b/src/panels/config/tags/ha-config-tags.ts index 2fbe093f437f..afc3f48b6497 100644 --- a/src/panels/config/tags/ha-config-tags.ts +++ b/src/panels/config/tags/ha-config-tags.ts @@ -311,12 +311,14 @@ export class HaConfigTags extends SubscribeMixin(LitElement) { private async _removeTag(selectedTag: Tag) { if ( !(await showConfirmationDialog(this, { - title: "Remove tag?", - text: `Are you sure you want to remove tag ${ + title: this.hass!.localize("ui.panel.config.tags.confirm_remove_title"), + text: this.hass.localize( + "ui.panel.config.tags.confirm_remove", + "tag", selectedTag.name || selectedTag.id - }?`, - dismissText: this.hass!.localize("ui.common.no"), - confirmText: this.hass!.localize("ui.common.yes"), + ), + dismissText: this.hass!.localize("ui.common.cancel"), + confirmText: this.hass!.localize("ui.common.remove"), })) ) { return false; diff --git a/src/panels/config/users/ha-config-users.ts b/src/panels/config/users/ha-config-users.ts index 09ca727a220b..372e3332af1e 100644 --- a/src/panels/config/users/ha-config-users.ts +++ b/src/panels/config/users/ha-config-users.ts @@ -137,8 +137,8 @@ export class HaConfigUsers extends LitElement { "name", entry.name ), - dismissText: this.hass!.localize("ui.common.no"), - confirmText: this.hass!.localize("ui.common.yes"), + dismissText: this.hass!.localize("ui.common.cancel"), + confirmText: this.hass!.localize("ui.common.delete"), })) ) { return false; diff --git a/src/panels/config/zone/ha-config-zone.ts b/src/panels/config/zone/ha-config-zone.ts index 6f4f277ab695..e9ad03e7ca6c 100644 --- a/src/panels/config/zone/ha-config-zone.ts +++ b/src/panels/config/zone/ha-config-zone.ts @@ -439,10 +439,9 @@ export class HaConfigZone extends SubscribeMixin(LitElement) { private async _removeEntry(entry: Zone) { if ( !(await showConfirmationDialog(this, { - title: this.hass!.localize("ui.panel.config.zone.confirm_delete"), - text: this.hass!.localize("ui.panel.config.zone.confirm_delete2"), - dismissText: this.hass!.localize("ui.common.no"), - confirmText: this.hass!.localize("ui.common.yes"), + title: this.hass!.localize("ui.panel.config.zone.confirm_delete_title"), + dismissText: this.hass!.localize("ui.common.cancel"), + confirmText: this.hass!.localize("ui.common.delete"), })) ) { return false; diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts index 4c0c1cb903f9..17451ce612ad 100755 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts @@ -309,8 +309,8 @@ export class HuiDialogEditCard extends LitElement text: this.hass!.localize( "ui.panel.lovelace.editor.edit_card.confirm_cancel" ), - dismissText: this.hass!.localize("ui.common.no"), - confirmText: this.hass!.localize("ui.common.yes"), + dismissText: this.hass!.localize("ui.common.stay"), + confirmText: this.hass!.localize("ui.common.leave"), }); if (confirm) { this._cancel(); diff --git a/src/panels/lovelace/hui-editor.ts b/src/panels/lovelace/hui-editor.ts index 84a9f86fe19a..24909716a756 100644 --- a/src/panels/lovelace/hui-editor.ts +++ b/src/panels/lovelace/hui-editor.ts @@ -173,8 +173,8 @@ class LovelaceFullConfigEditor extends LitElement { text: this.hass.localize( "ui.panel.lovelace.editor.raw_editor.confirm_unsaved_changes" ), - dismissText: this.hass!.localize("ui.common.no"), - confirmText: this.hass!.localize("ui.common.yes"), + dismissText: this.hass!.localize("ui.common.leave"), + confirmText: this.hass!.localize("ui.common.stay"), })) ) { return; @@ -217,8 +217,8 @@ class LovelaceFullConfigEditor extends LitElement { text: this.hass.localize( "ui.panel.lovelace.editor.raw_editor.confirm_remove_config_text" ), - confirmText: this.hass.localize("ui.common.yes"), - dismissText: this.hass.localize("ui.common.no"), + confirmText: this.hass.localize("ui.common.remove"), + dismissText: this.hass.localize("ui.common.cancel"), confirm: () => this._removeConfig(), }); return; diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index b8516170e376..9f14c9c9b66f 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -609,7 +609,7 @@ class HUIRoot extends LitElement { "ui.panel.lovelace.reload_resources.refresh_body" ), confirmText: this.hass.localize("ui.common.refresh"), - dismissText: this.hass.localize("ui.common.no"), + dismissText: this.hass.localize("ui.common.not_now"), confirm: () => location.reload(), }); } diff --git a/src/translations/en.json b/src/translations/en.json index 65037b6c58a2..d5b97f27b833 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -269,13 +269,20 @@ "refresh": "Refresh", "cancel": "Cancel", "delete": "Delete", + "remove": "Remove", + "enable": "Enable", + "disable": "Disable", "close": "Close", + "leave": "Leave", + "stay": "Stay", "next": "Next", "back": "Back", "undo": "Undo", "save": "Save", + "rename": "Rename", "yes": "Yes", "no": "No", + "not_now": "Not now", "menu": "Menu", "overflow_menu": "Overflow menu", "successfully_saved": "Successfully saved", @@ -781,6 +788,8 @@ "edit": "Edit", "never_scanned": "Never scanned", "create_automation": "Create automation with tag", + "confirm_remove_title": "Remove tag?", + "confirm_remove": "Are you sure you want to remove tag {tag}?", "automation_title": "Tag {name} is scanned", "headers": { "name": "Name", @@ -1711,18 +1720,18 @@ "selected": "{number} selected", "enable_selected": { "button": "Enable selected", - "confirm_title": "Do you want to enable {number} entities?", + "confirm_title": "Do you want to enable {number} {number, plural,\n one {entity}\n other {entities}\n}?", "confirm_text": "This will make them available in Home Assistant again if they are now disabled." }, "disable_selected": { "button": "Disable selected", - "confirm_title": "Do you want to disable {number} entities?", + "confirm_title": "Do you want to disable {number} {number, plural,\n one {entity}\n other {entities}\n}?", "confirm_text": "Disabled entities will not be added to Home Assistant." }, "remove_selected": { "button": "Remove selected", - "confirm_title": "Do you want to remove {number} entities?", - "confirm_partly_title": "Only {number} selected entities can be removed.", + "confirm_title": "Do you want to remove {number} {number, plural,\n one {entity}\n other {entities}\n}?", + "confirm_partly_title": "Only {number} {number, plural,\n one {selected entity}\n other {selected entities}\n} can be removed.", "confirm_text": "You should remove them from your Lovelace config and automations if they contain these entities.", "confirm_partly_text": "You can only remove {removable} of the selected {selected} entities. Entities can only be removed when the integration is no longer providing the entities. Sometimes you have to restart Home Assistant before you can remove the entities of a removed integration. Are you sure you want to remove the removable entities?" } @@ -1737,8 +1746,8 @@ "no_persons_created_yet": "Looks like you have not created any people yet.", "create_person": "Create Person", "add_person": "Add Person", - "confirm_delete": "Are you sure you want to delete this person?", - "confirm_delete2": "All devices belonging to this person will become unassigned.", + "confirm_delete_title": "Are you sure you want to delete this person?", + "confirm_delete": "All devices belonging to this person will become unassigned.", "person_not_found_title": "Person Not Found", "person_not_found": "We couldn't find the person you were trying to edit.", "detail": { @@ -1767,7 +1776,7 @@ "no_zones_created_yet": "Looks like you have not created any zones yet.", "create_zone": "Create Zone", "add_zone": "Add Zone", - "confirm_delete": "Are you sure you want to delete this zone?", + "confirm_delete_title": "Are you sure you want to delete this zone?", "configured_in_yaml": "Zones configured via configuration.yaml cannot be edited via the UI.", "edit_home_zone": "The radius of the Home zone can't be edited from the frontend yet. Drag the marker on the map to move the home zone.", "edit_home_zone_narrow": "The radius of the Home zone can't be edited from the frontend yet. The location can be changed from the general configuration.", From 54cd9286b8911fd394576d17731f03bc85ae97d4 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Mon, 9 Nov 2020 23:21:59 +0100 Subject: [PATCH 4/4] Changes from review --- src/panels/config/person/ha-config-person.ts | 6 ++---- src/panels/config/zone/ha-config-zone.ts | 2 +- src/translations/en.json | 6 +++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/panels/config/person/ha-config-person.ts b/src/panels/config/person/ha-config-person.ts index 746e221981f5..a47292894069 100644 --- a/src/panels/config/person/ha-config-person.ts +++ b/src/panels/config/person/ha-config-person.ts @@ -245,10 +245,8 @@ class HaConfigPerson extends LitElement { removeEntry: async () => { if ( !(await showConfirmationDialog(this, { - title: this.hass!.localize( - "ui.panel.config.person.confirm_delete_title" - ), - text: this.hass!.localize("ui.panel.config.person.confirm_delete"), + title: this.hass!.localize("ui.panel.config.person.confirm_delete"), + text: this.hass!.localize("ui.panel.config.person.confirm_delete2"), dismissText: this.hass!.localize("ui.common.cancel"), confirmText: this.hass!.localize("ui.common.delete"), })) diff --git a/src/panels/config/zone/ha-config-zone.ts b/src/panels/config/zone/ha-config-zone.ts index e9ad03e7ca6c..558a4b78afbe 100644 --- a/src/panels/config/zone/ha-config-zone.ts +++ b/src/panels/config/zone/ha-config-zone.ts @@ -439,7 +439,7 @@ export class HaConfigZone extends SubscribeMixin(LitElement) { private async _removeEntry(entry: Zone) { if ( !(await showConfirmationDialog(this, { - title: this.hass!.localize("ui.panel.config.zone.confirm_delete_title"), + title: this.hass!.localize("ui.panel.config.zone.confirm_delete"), dismissText: this.hass!.localize("ui.common.cancel"), confirmText: this.hass!.localize("ui.common.delete"), })) diff --git a/src/translations/en.json b/src/translations/en.json index d5b97f27b833..52e88cb378b7 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1746,8 +1746,8 @@ "no_persons_created_yet": "Looks like you have not created any people yet.", "create_person": "Create Person", "add_person": "Add Person", - "confirm_delete_title": "Are you sure you want to delete this person?", - "confirm_delete": "All devices belonging to this person will become unassigned.", + "confirm_delete": "Are you sure you want to delete this person?", + "confirm_delete2": "All devices belonging to this person will become unassigned.", "person_not_found_title": "Person Not Found", "person_not_found": "We couldn't find the person you were trying to edit.", "detail": { @@ -1776,7 +1776,7 @@ "no_zones_created_yet": "Looks like you have not created any zones yet.", "create_zone": "Create Zone", "add_zone": "Add Zone", - "confirm_delete_title": "Are you sure you want to delete this zone?", + "confirm_delete": "Are you sure you want to delete this zone?", "configured_in_yaml": "Zones configured via configuration.yaml cannot be edited via the UI.", "edit_home_zone": "The radius of the Home zone can't be edited from the frontend yet. Drag the marker on the map to move the home zone.", "edit_home_zone_narrow": "The radius of the Home zone can't be edited from the frontend yet. The location can be changed from the general configuration.",