mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Add missing translations to statistics graph card editor (#13836)
This commit is contained in:
parent
cedde3d6a2
commit
977fdd9fbb
@ -65,12 +65,6 @@ const cardConfigStruct = assign(
|
|||||||
|
|
||||||
const periods = ["5minute", "hour", "day", "month"] as const;
|
const periods = ["5minute", "hour", "day", "month"] as const;
|
||||||
const stat_types = ["mean", "min", "max", "sum"] as const;
|
const stat_types = ["mean", "min", "max", "sum"] as const;
|
||||||
const stat_type_labels = {
|
|
||||||
mean: "Mean",
|
|
||||||
min: "Min",
|
|
||||||
max: "Max",
|
|
||||||
sum: "Sum",
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
@customElement("hui-statistics-graph-card-editor")
|
@customElement("hui-statistics-graph-card-editor")
|
||||||
export class HuiStatisticsGraphCardEditor
|
export class HuiStatisticsGraphCardEditor
|
||||||
@ -156,7 +150,9 @@ export class HuiStatisticsGraphCardEditor
|
|||||||
multiple: true,
|
multiple: true,
|
||||||
options: stat_types.map((stat_type) => ({
|
options: stat_types.map((stat_type) => ({
|
||||||
value: stat_type,
|
value: stat_type,
|
||||||
label: stat_type_labels[stat_type],
|
label: localize(
|
||||||
|
`ui.panel.lovelace.editor.card.statistics-graph.stat_type_labels.${stat_type}`
|
||||||
|
),
|
||||||
disabled:
|
disabled:
|
||||||
!metaDatas ||
|
!metaDatas ||
|
||||||
!metaDatas?.every((metaData) =>
|
!metaDatas?.every((metaData) =>
|
||||||
@ -214,8 +210,12 @@ export class HuiStatisticsGraphCardEditor
|
|||||||
></ha-form>
|
></ha-form>
|
||||||
<ha-statistics-picker
|
<ha-statistics-picker
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.pickStatisticLabel=${`Add a statistic`}
|
.pickStatisticLabel=${this.hass!.localize(
|
||||||
.pickedStatisticLabel=${`Statistic`}
|
"ui.panel.lovelace.editor.card.statistics-graph.pick_statistic"
|
||||||
|
)}
|
||||||
|
.pickedStatisticLabel=${this.hass!.localize(
|
||||||
|
"ui.panel.lovelace.editor.card.statistics-graph.picked_statistic"
|
||||||
|
)}
|
||||||
.includeDisplayUnitOfMeasurement=${displayUnit}
|
.includeDisplayUnitOfMeasurement=${displayUnit}
|
||||||
.ignoreRestrictionsOnFirstStatistic=${true}
|
.ignoreRestrictionsOnFirstStatistic=${true}
|
||||||
.value=${this._configEntities}
|
.value=${this._configEntities}
|
||||||
|
@ -3929,13 +3929,21 @@
|
|||||||
"description": "The Statistics Graph card allows you to display a graph of the statistics for each of the entities listed.",
|
"description": "The Statistics Graph card allows you to display a graph of the statistics for each of the entities listed.",
|
||||||
"period": "Period",
|
"period": "Period",
|
||||||
"stat_types": "Show stat types",
|
"stat_types": "Show stat types",
|
||||||
|
"stat_type_labels": {
|
||||||
|
"mean": "Mean",
|
||||||
|
"min": "Min",
|
||||||
|
"max": "Max",
|
||||||
|
"sum": "Sum"
|
||||||
|
},
|
||||||
"chart_type": "Chart type",
|
"chart_type": "Chart type",
|
||||||
"periods": {
|
"periods": {
|
||||||
"hour": "Hour",
|
"hour": "Hour",
|
||||||
"day": "Day",
|
"day": "Day",
|
||||||
"month": "Month",
|
"month": "Month",
|
||||||
"5minute": "5 Minutes"
|
"5minute": "5 Minutes"
|
||||||
}
|
},
|
||||||
|
"pick_statistic": "Add a statistic",
|
||||||
|
"picked_statistic": "Statistic"
|
||||||
},
|
},
|
||||||
"horizontal-stack": {
|
"horizontal-stack": {
|
||||||
"name": "Horizontal Stack",
|
"name": "Horizontal Stack",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user