Fix missing translatable energy texts (#12877)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Philip Allgaier <philip.allgaier@gmx.de>
This commit is contained in:
Emanuele 2022-06-23 11:02:02 +02:00 committed by GitHub
parent 2812b467ec
commit 709bc87a36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 18 deletions

View File

@ -56,21 +56,23 @@ export class HuiEnergyCompareCard
return html` return html`
<ha-alert dismissable @alert-dismissed-clicked=${this._stopCompare}> <ha-alert dismissable @alert-dismissed-clicked=${this._stopCompare}>
You are comparing the period ${this.hass.localize("ui.panel.energy.compare.info", {
<b start: html`<b
>${formatDate(this._start!, this.hass.locale)}${dayDifference > 0 >${formatDate(this._start!, this.hass.locale)}${dayDifference > 0
? ` - ? ` -
${formatDate(this._end || endOfDay(new Date()), this.hass.locale)}` ${formatDate(this._end || endOfDay(new Date()), this.hass.locale)}`
: ""}</b : ""}</b
> >`,
with period end: html`<b
<b >${formatDate(
>${formatDate(this._startCompare, this.hass.locale)}${dayDifference > this._startCompare,
0 this.hass.locale
? ` - )}${dayDifference > 0
${formatDate(this._endCompare, this.hass.locale)}` ? ` -
: ""}</b ${formatDate(this._endCompare, this.hass.locale)}`
> : ""}</b
>`,
})}
</ha-alert> </ha-alert>
`; `;
} }

View File

@ -151,7 +151,9 @@ export class HuiEnergyPeriodSelector extends SubscribeMixin(LitElement) {
dense dense
outlined outlined
> >
Compare data ${this.hass.localize(
"ui.panel.lovelace.components.energy_period_selector.compare"
)}
</ha-icon-button>` </ha-icon-button>`
: html`<mwc-button : html`<mwc-button
class="compare ${this._compare ? "active" : ""}" class="compare ${this._compare ? "active" : ""}"
@ -159,7 +161,9 @@ export class HuiEnergyPeriodSelector extends SubscribeMixin(LitElement) {
dense dense
outlined outlined
> >
Compare data ${this.hass.localize(
"ui.panel.lovelace.components.energy_period_selector.compare"
)}
</mwc-button>`} </mwc-button>`}
</div> </div>
</div> </div>

View File

@ -2429,6 +2429,10 @@
"title": "Entity not tracked" "title": "Entity not tracked"
} }
} }
},
"compare":{
"info": "You are comparing the period {start} with {end}"
} }
}, },
"entities": { "entities": {
@ -3852,7 +3856,8 @@
"previous": "Previous", "previous": "Previous",
"today": "Today", "today": "Today",
"week": "Week", "week": "Week",
"year": "Year" "year": "Year",
"compare": "Compare data"
}, },
"timestamp-display": { "timestamp-display": {
"invalid": "Invalid timestamp", "invalid": "Invalid timestamp",