From 83570f2419d2d1964afe196fe77ea8fab42be626 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Fri, 26 May 2023 23:01:52 +0200 Subject: [PATCH] Add missing translations for effect and preset translation in more info (#16634) --- .../more-info/controls/more-info-fan.ts | 22 ++++++++---- .../more-info/controls/more-info-light.ts | 36 ++++++++++++++----- 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/src/dialogs/more-info/controls/more-info-fan.ts b/src/dialogs/more-info/controls/more-info-fan.ts index 15c3a1af42..af32733d77 100644 --- a/src/dialogs/more-info/controls/more-info-fan.ts +++ b/src/dialogs/more-info/controls/more-info-fan.ts @@ -276,13 +276,21 @@ class MoreInfoFan extends LitElement { slot="trigger" .disabled=${this.stateObj.state === UNAVAILABLE} > - ${this._presetMode || - computeAttributeNameDisplay( - this.hass.localize, - this.stateObj, - this.hass.entities, - "preset_mode" - )} + ${this._presetMode + ? computeAttributeValueDisplay( + this.hass.localize, + this.stateObj!, + this.hass.locale, + this.hass.entities, + "preset_mode", + this._presetMode + ) + : computeAttributeNameDisplay( + this.hass.localize, + this.stateObj, + this.hass.entities, + "preset_mode" + )} - ${this._effect || - computeAttributeNameDisplay( - this.hass.localize, - this.stateObj, - this.hass.entities, - "effect" - )} + ${this._effect + ? computeAttributeValueDisplay( + this.hass.localize, + this.stateObj!, + this.hass.locale, + this.hass.entities, + "effect", + this._effect + ) + : computeAttributeNameDisplay( + this.hass.localize, + this.stateObj, + this.hass.entities, + "effect" + )} ${this.stateObj.attributes.effect_list.map( (effect: string) => html` @@ -250,7 +261,14 @@ class MoreInfoLight extends LitElement { .value=${effect} .activated=${this.stateObj!.attributes.effect === effect} > - ${effect} + ${computeAttributeValueDisplay( + this.hass.localize, + this.stateObj!, + this.hass.locale, + this.hass.entities, + "effect", + effect + )} ` )}