Translate assigned-to / targeting-this area info (#11337)

This commit is contained in:
Philip Allgaier 2022-01-17 05:52:35 +01:00 committed by GitHub
parent 884ed561a1
commit effec839af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 7 deletions

View File

@ -265,7 +265,11 @@ class HaConfigAreaPage extends LitElement {
)} )}
> >
${grouped.automation?.length ${grouped.automation?.length
? html`<h3>Assigned to this area:</h3> ? html`<h3>
${this.hass.localize(
"ui.panel.config.areas.assigned_to_area"
)}:
</h3>
${grouped.automation.map((entity) => { ${grouped.automation.map((entity) => {
const entityState = this.hass.states[ const entityState = this.hass.states[
entity.entity_id entity.entity_id
@ -281,7 +285,11 @@ class HaConfigAreaPage extends LitElement {
(entity) => entity.entity_id === entityId (entity) => entity.entity_id === entityId
) )
).length ).length
? html`<h3>Targeting this area:</h3> ? html`<h3>
${this.hass.localize(
"ui.panel.config.areas.targeting_area"
)}:
</h3>
${this._related.automation.map((scene) => { ${this._related.automation.map((scene) => {
const entityState = this.hass.states[scene] as const entityState = this.hass.states[scene] as
| AutomationEntity | AutomationEntity
@ -314,7 +322,11 @@ class HaConfigAreaPage extends LitElement {
)} )}
> >
${grouped.scene?.length ${grouped.scene?.length
? html`<h3>Assigned to this area:</h3> ? html`<h3>
${this.hass.localize(
"ui.panel.config.areas.assigned_to_area"
)}:
</h3>
${grouped.scene.map((entity) => { ${grouped.scene.map((entity) => {
const entityState = const entityState =
this.hass.states[entity.entity_id]; this.hass.states[entity.entity_id];
@ -329,7 +341,11 @@ class HaConfigAreaPage extends LitElement {
(entity) => entity.entity_id === entityId (entity) => entity.entity_id === entityId
) )
).length ).length
? html`<h3>Targeting this area:</h3> ? html`<h3>
${this.hass.localize(
"ui.panel.config.areas.targeting_area"
)}:
</h3>
${this._related.scene.map((scene) => { ${this._related.scene.map((scene) => {
const entityState = this.hass.states[scene]; const entityState = this.hass.states[scene];
return entityState return entityState
@ -357,7 +373,11 @@ class HaConfigAreaPage extends LitElement {
)} )}
> >
${grouped.script?.length ${grouped.script?.length
? html`<h3>Assigned to this area:</h3> ? html`<h3>
${this.hass.localize(
"ui.panel.config.areas.assigned_to_area"
)}:
</h3>
${grouped.script.map((entity) => { ${grouped.script.map((entity) => {
const entityState = this.hass.states[ const entityState = this.hass.states[
entity.entity_id entity.entity_id
@ -373,7 +393,11 @@ class HaConfigAreaPage extends LitElement {
(entity) => entity.entity_id === entityId (entity) => entity.entity_id === entityId
) )
).length ).length
? html`<h3>Targeting this area:</h3> ? html`<h3>
${this.hass.localize(
"ui.panel.config.areas.targeting_area"
)}:
</h3>
${this._related.script.map((scene) => { ${this._related.script.map((scene) => {
const entityState = this.hass.states[scene] as const entityState = this.hass.states[scene] as
| ScriptEntity | ScriptEntity

View File

@ -36,7 +36,7 @@ export class EnergyStrategy {
} }
view.cards!.push({ view.cards!.push({
type: "markdown", 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; return view;
} }

View File

@ -1006,6 +1006,8 @@
"description": "Group devices and entities into areas", "description": "Group devices and entities into areas",
"edit_settings": "Area settings", "edit_settings": "Area settings",
"add_picture": "Add a picture", "add_picture": "Add a picture",
"assigned_to_area": "Assigned to this area",
"targeting_area": "Targeting this area",
"data_table": { "data_table": {
"area": "Area", "area": "Area",
"devices": "Devices", "devices": "Devices",