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

View File

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

View File

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