From effec839afd4375e44880a93c26ee47d9c0f8fa6 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Mon, 17 Jan 2022 05:52:35 +0100 Subject: [PATCH] Translate assigned-to / targeting-this area info (#11337) --- .../config/areas/ha-config-area-page.ts | 36 +++++++++++++++---- .../energy/strategies/energy-strategy.ts | 2 +- src/translations/en.json | 2 ++ 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/panels/config/areas/ha-config-area-page.ts b/src/panels/config/areas/ha-config-area-page.ts index be0db42577..285d18bba7 100644 --- a/src/panels/config/areas/ha-config-area-page.ts +++ b/src/panels/config/areas/ha-config-area-page.ts @@ -265,7 +265,11 @@ class HaConfigAreaPage extends LitElement { )} > ${grouped.automation?.length - ? html`

Assigned to this area:

+ ? html`

+ ${this.hass.localize( + "ui.panel.config.areas.assigned_to_area" + )}: +

${grouped.automation.map((entity) => { const entityState = this.hass.states[ entity.entity_id @@ -281,7 +285,11 @@ class HaConfigAreaPage extends LitElement { (entity) => entity.entity_id === entityId ) ).length - ? html`

Targeting this area:

+ ? html`

+ ${this.hass.localize( + "ui.panel.config.areas.targeting_area" + )}: +

${this._related.automation.map((scene) => { const entityState = this.hass.states[scene] as | AutomationEntity @@ -314,7 +322,11 @@ class HaConfigAreaPage extends LitElement { )} > ${grouped.scene?.length - ? html`

Assigned to this area:

+ ? html`

+ ${this.hass.localize( + "ui.panel.config.areas.assigned_to_area" + )}: +

${grouped.scene.map((entity) => { const entityState = this.hass.states[entity.entity_id]; @@ -329,7 +341,11 @@ class HaConfigAreaPage extends LitElement { (entity) => entity.entity_id === entityId ) ).length - ? html`

Targeting this area:

+ ? html`

+ ${this.hass.localize( + "ui.panel.config.areas.targeting_area" + )}: +

${this._related.scene.map((scene) => { const entityState = this.hass.states[scene]; return entityState @@ -357,7 +373,11 @@ class HaConfigAreaPage extends LitElement { )} > ${grouped.script?.length - ? html`

Assigned to this area:

+ ? html`

+ ${this.hass.localize( + "ui.panel.config.areas.assigned_to_area" + )}: +

${grouped.script.map((entity) => { const entityState = this.hass.states[ entity.entity_id @@ -373,7 +393,11 @@ class HaConfigAreaPage extends LitElement { (entity) => entity.entity_id === entityId ) ).length - ? html`

Targeting this area:

+ ? html`

+ ${this.hass.localize( + "ui.panel.config.areas.targeting_area" + )}: +

${this._related.script.map((scene) => { const entityState = this.hass.states[scene] as | ScriptEntity diff --git a/src/panels/energy/strategies/energy-strategy.ts b/src/panels/energy/strategies/energy-strategy.ts index 41827e062b..4ba3125124 100644 --- a/src/panels/energy/strategies/energy-strategy.ts +++ b/src/panels/energy/strategies/energy-strategy.ts @@ -36,7 +36,7 @@ export class EnergyStrategy { } view.cards!.push({ type: "markdown", - content: `An error occured while fetching your energy preferences: ${err.message}.`, + content: `An error occurred while fetching your energy preferences: ${err.message}.`, }); return view; } diff --git a/src/translations/en.json b/src/translations/en.json index 96b9b6804e..19736ff509 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1006,6 +1006,8 @@ "description": "Group devices and entities into areas", "edit_settings": "Area settings", "add_picture": "Add a picture", + "assigned_to_area": "Assigned to this area", + "targeting_area": "Targeting this area", "data_table": { "area": "Area", "devices": "Devices",