mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Translate timestamp-display errors + tiny tweaks (#8086)
* Translate timestamp-display errors + tiny tweaks * Adjust translation key
This commit is contained in:
parent
2c2226dfd6
commit
13b69bff1b
@ -57,7 +57,9 @@ class HuiTimestampDisplay extends LitElement {
|
||||
}
|
||||
|
||||
if (isNaN(this.ts.getTime())) {
|
||||
return html` Invalid date `;
|
||||
return html`${this.hass.localize(
|
||||
"ui.panel.lovelace.components.timestamp-display.invalid"
|
||||
)}`;
|
||||
}
|
||||
|
||||
const format = this._format;
|
||||
@ -68,7 +70,9 @@ class HuiTimestampDisplay extends LitElement {
|
||||
if (format in FORMATS) {
|
||||
return html` ${FORMATS[format](this.ts, this.hass.language)} `;
|
||||
}
|
||||
return html` Invalid format `;
|
||||
return html`${this.hass.localize(
|
||||
"ui.panel.lovelace.components.timestamp-display.invalid_format"
|
||||
)}`;
|
||||
}
|
||||
|
||||
protected updated(changedProperties: PropertyValues): void {
|
||||
|
@ -71,7 +71,7 @@ const DOMAIN_TO_ELEMENT_TYPE = {
|
||||
switch: "toggle",
|
||||
vacuum: "toggle",
|
||||
// Temporary. Once climate is rewritten,
|
||||
// water heater should get it's own row.
|
||||
// water heater should get its own row.
|
||||
water_heater: "climate",
|
||||
input_datetime: "input-datetime",
|
||||
weather: "weather",
|
||||
|
@ -25,7 +25,7 @@ import { handleAction } from "../common/handle-action";
|
||||
import { UNAVAILABLE_STATES } from "../../../data/entity";
|
||||
|
||||
interface SensorEntityConfig extends EntitiesCardEntityConfig {
|
||||
format?: "relative" | "date" | "time" | "datetime";
|
||||
format?: "relative" | "total" | "date" | "time" | "datetime";
|
||||
}
|
||||
|
||||
@customElement("hui-sensor-entity-row")
|
||||
|
@ -2834,6 +2834,12 @@
|
||||
"changed_toast": {
|
||||
"message": "The Lovelace UI configuration for this dashboard was updated. Refresh to see changes?"
|
||||
},
|
||||
"components": {
|
||||
"timestamp-display": {
|
||||
"invalid": "Invalid timestamp",
|
||||
"invalid_format": "Invalid display format"
|
||||
}
|
||||
},
|
||||
"reload_lovelace": "Reload UI"
|
||||
},
|
||||
"mailbox": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user