mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 00:06:35 +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())) {
|
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;
|
const format = this._format;
|
||||||
@ -68,7 +70,9 @@ class HuiTimestampDisplay extends LitElement {
|
|||||||
if (format in FORMATS) {
|
if (format in FORMATS) {
|
||||||
return html` ${FORMATS[format](this.ts, this.hass.language)} `;
|
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 {
|
protected updated(changedProperties: PropertyValues): void {
|
||||||
|
@ -71,7 +71,7 @@ const DOMAIN_TO_ELEMENT_TYPE = {
|
|||||||
switch: "toggle",
|
switch: "toggle",
|
||||||
vacuum: "toggle",
|
vacuum: "toggle",
|
||||||
// Temporary. Once climate is rewritten,
|
// Temporary. Once climate is rewritten,
|
||||||
// water heater should get it's own row.
|
// water heater should get its own row.
|
||||||
water_heater: "climate",
|
water_heater: "climate",
|
||||||
input_datetime: "input-datetime",
|
input_datetime: "input-datetime",
|
||||||
weather: "weather",
|
weather: "weather",
|
||||||
|
@ -25,7 +25,7 @@ import { handleAction } from "../common/handle-action";
|
|||||||
import { UNAVAILABLE_STATES } from "../../../data/entity";
|
import { UNAVAILABLE_STATES } from "../../../data/entity";
|
||||||
|
|
||||||
interface SensorEntityConfig extends EntitiesCardEntityConfig {
|
interface SensorEntityConfig extends EntitiesCardEntityConfig {
|
||||||
format?: "relative" | "date" | "time" | "datetime";
|
format?: "relative" | "total" | "date" | "time" | "datetime";
|
||||||
}
|
}
|
||||||
|
|
||||||
@customElement("hui-sensor-entity-row")
|
@customElement("hui-sensor-entity-row")
|
||||||
|
@ -2834,6 +2834,12 @@
|
|||||||
"changed_toast": {
|
"changed_toast": {
|
||||||
"message": "The Lovelace UI configuration for this dashboard was updated. Refresh to see changes?"
|
"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"
|
"reload_lovelace": "Reload UI"
|
||||||
},
|
},
|
||||||
"mailbox": {
|
"mailbox": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user