From 8d0608610f2593d8856350314af55853371a7d9b Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Wed, 27 Jan 2021 12:35:25 +0100 Subject: [PATCH] Entity registry: Translate advanced section + direct link to entity customization (#8181) --- src/components/ha-expansion-panel.ts | 2 ++ .../config/entities/dialog-entity-editor.ts | 15 ++++++++++ .../entities/entity-registry-settings.ts | 29 ++++++++++++++----- src/translations/en.json | 9 +++++- 4 files changed, 47 insertions(+), 8 deletions(-) diff --git a/src/components/ha-expansion-panel.ts b/src/components/ha-expansion-panel.ts index 83eac261d0..be3dc4f77d 100644 --- a/src/components/ha-expansion-panel.ts +++ b/src/components/ha-expansion-panel.ts @@ -74,6 +74,7 @@ class HaExpansionPanel extends LitElement { var(--divider-color, #e0e0e0) ); border-radius: var(--ha-card-border-radius, 4px); + padding: 0 8px; } .summary { @@ -83,6 +84,7 @@ class HaExpansionPanel extends LitElement { align-items: center; cursor: pointer; overflow: hidden; + font-weight: 500; } .summary-icon { diff --git a/src/panels/config/entities/dialog-entity-editor.ts b/src/panels/config/entities/dialog-entity-editor.ts index cf534ab968..eaca43da79 100644 --- a/src/panels/config/entities/dialog-entity-editor.ts +++ b/src/panels/config/entities/dialog-entity-editor.ts @@ -184,6 +184,21 @@ export class DialogEntityEditor extends LitElement { >${this.hass.localize("ui.dialogs.entity_registry.faq")}` )} + ${this.hass.userData?.showAdvanced + ? html`

+ ${this.hass.localize( + "ui.dialogs.entity_registry.info_customize", + "customize_link", + html`${this.hass.localize( + "ui.dialogs.entity_registry.customize_link" + )}` + )}` + : ""} `; case "tab-related": diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index 81187ab27b..6e60b08bfe 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -201,25 +201,37 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { ${this.entry.device_id - ? html` + ? html`

- By default the entities of a device are in the same area as the - device. If you change the area of this entity, it will no longer - follow the area of the device. + ${this.hass.localize( + "ui.dialogs.entity_registry.editor.area_note" + )}

${this._areaId ? html`Follow device area${this.hass.localize( + "ui.dialogs.entity_registry.editor.follow_device_area" + )}` : this._device ? html`Change device area${this.hass.localize( + "ui.dialogs.entity_registry.editor.change_device_area" + )}` : ""}
` @@ -377,11 +389,14 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { margin-right: 16px; } .row { - margin-top: 8px; + margin: 8px 0; color: var(--primary-text-color); display: flex; align-items: center; } + p { + margin: 8px 0; + } `, ]; } diff --git a/src/translations/en.json b/src/translations/en.json index c54528db73..5bfdedcabe 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -625,6 +625,8 @@ "dismiss": "Dismiss", "no_unique_id": "This entity (\"{entity_id}\") does not have a unique ID, therefore its settings cannot be managed from the UI. See the {faq_link} for more detail.", "faq": "documentation", + "info_customize": "You can overwrite some attributes in the {customize_link} section.", + "customize_link": "entity customizations", "editor": { "name": "Name", "icon": "Icon", @@ -641,7 +643,12 @@ "delete": "Delete", "confirm_delete": "Are you sure you want to delete this entry?", "update": "Update", - "note": "Note: This might not work yet with all integrations." + "note": "Note: This might not work yet with all integrations.", + "advanced": "Advanced settings", + "area": "Set entity area only", + "area_note": "By default the entities of a device are in the same area as the device. If you change the area of this entity, it will no longer follow the area of the device.", + "follow_device_area": "Follow device area", + "change_device_area": "Change device area" } }, "helper_settings": {