mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Add missing translations for areas strategy (#24905)
This commit is contained in:
parent
ca223f9d73
commit
e271989cee
@ -8,7 +8,6 @@ import type { LovelaceViewConfig } from "../../../../data/lovelace/config/view";
|
|||||||
import type { HomeAssistant } from "../../../../types";
|
import type { HomeAssistant } from "../../../../types";
|
||||||
import {
|
import {
|
||||||
AREA_STRATEGY_GROUP_ICONS,
|
AREA_STRATEGY_GROUP_ICONS,
|
||||||
AREA_STRATEGY_GROUP_LABELS,
|
|
||||||
computeAreaTileCardConfig,
|
computeAreaTileCardConfig,
|
||||||
getAreaGroupedEntities,
|
getAreaGroupedEntities,
|
||||||
} from "./helpers/areas-strategy-helper";
|
} from "./helpers/areas-strategy-helper";
|
||||||
@ -85,7 +84,7 @@ export class AreaViewStrategy extends ReactiveElement {
|
|||||||
type: "grid",
|
type: "grid",
|
||||||
cards: [
|
cards: [
|
||||||
computeHeadingCard(
|
computeHeadingCard(
|
||||||
AREA_STRATEGY_GROUP_LABELS.lights,
|
hass.localize("ui.panel.lovelace.strategy.areas.groups.lights"),
|
||||||
AREA_STRATEGY_GROUP_ICONS.lights
|
AREA_STRATEGY_GROUP_ICONS.lights
|
||||||
),
|
),
|
||||||
...lights.map(computeTileCard),
|
...lights.map(computeTileCard),
|
||||||
@ -98,7 +97,7 @@ export class AreaViewStrategy extends ReactiveElement {
|
|||||||
type: "grid",
|
type: "grid",
|
||||||
cards: [
|
cards: [
|
||||||
computeHeadingCard(
|
computeHeadingCard(
|
||||||
AREA_STRATEGY_GROUP_LABELS.climate,
|
hass.localize("ui.panel.lovelace.strategy.areas.groups.climate"),
|
||||||
AREA_STRATEGY_GROUP_ICONS.climate
|
AREA_STRATEGY_GROUP_ICONS.climate
|
||||||
),
|
),
|
||||||
...climate.map(computeTileCard),
|
...climate.map(computeTileCard),
|
||||||
@ -111,7 +110,9 @@ export class AreaViewStrategy extends ReactiveElement {
|
|||||||
type: "grid",
|
type: "grid",
|
||||||
cards: [
|
cards: [
|
||||||
computeHeadingCard(
|
computeHeadingCard(
|
||||||
AREA_STRATEGY_GROUP_LABELS.media_players,
|
hass.localize(
|
||||||
|
"ui.panel.lovelace.strategy.areas.groups.media_players"
|
||||||
|
),
|
||||||
AREA_STRATEGY_GROUP_ICONS.media_players
|
AREA_STRATEGY_GROUP_ICONS.media_players
|
||||||
),
|
),
|
||||||
...media_players.map(computeTileCard),
|
...media_players.map(computeTileCard),
|
||||||
@ -124,7 +125,7 @@ export class AreaViewStrategy extends ReactiveElement {
|
|||||||
type: "grid",
|
type: "grid",
|
||||||
cards: [
|
cards: [
|
||||||
computeHeadingCard(
|
computeHeadingCard(
|
||||||
AREA_STRATEGY_GROUP_LABELS.security,
|
hass.localize("ui.panel.lovelace.strategy.areas.groups.security"),
|
||||||
AREA_STRATEGY_GROUP_ICONS.security
|
AREA_STRATEGY_GROUP_ICONS.security
|
||||||
),
|
),
|
||||||
...security.map(computeTileCard),
|
...security.map(computeTileCard),
|
||||||
@ -137,7 +138,7 @@ export class AreaViewStrategy extends ReactiveElement {
|
|||||||
type: "grid",
|
type: "grid",
|
||||||
cards: [
|
cards: [
|
||||||
computeHeadingCard(
|
computeHeadingCard(
|
||||||
AREA_STRATEGY_GROUP_LABELS.others,
|
hass.localize("ui.panel.lovelace.strategy.areas.groups.others"),
|
||||||
AREA_STRATEGY_GROUP_ICONS.others
|
AREA_STRATEGY_GROUP_ICONS.others
|
||||||
),
|
),
|
||||||
...others.map(computeTileCard),
|
...others.map(computeTileCard),
|
||||||
|
@ -12,7 +12,6 @@ import type { AreaStrategyGroup } from "../helpers/areas-strategy-helper";
|
|||||||
import {
|
import {
|
||||||
AREA_STRATEGY_GROUP_ICONS,
|
AREA_STRATEGY_GROUP_ICONS,
|
||||||
AREA_STRATEGY_GROUPS,
|
AREA_STRATEGY_GROUPS,
|
||||||
AREA_STRATEGY_GROUP_LABELS,
|
|
||||||
getAreaGroupedEntities,
|
getAreaGroupedEntities,
|
||||||
} from "../helpers/areas-strategy-helper";
|
} from "../helpers/areas-strategy-helper";
|
||||||
import type { LovelaceStrategyEditor } from "../../types";
|
import type { LovelaceStrategyEditor } from "../../types";
|
||||||
@ -57,7 +56,9 @@ export class HuiAreasDashboardStrategyEditor
|
|||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-expansion-panel
|
<ha-expansion-panel
|
||||||
header=${AREA_STRATEGY_GROUP_LABELS[group]}
|
header=${this.hass!.localize(
|
||||||
|
`ui.panel.lovelace.strategy.areas.groups.${group}`
|
||||||
|
)}
|
||||||
expanded
|
expanded
|
||||||
outlined
|
outlined
|
||||||
>
|
>
|
||||||
@ -79,7 +80,9 @@ export class HuiAreasDashboardStrategyEditor
|
|||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
<p>
|
<p>
|
||||||
No entities in this section, it will not be displayed.
|
${this.hass!.localize(
|
||||||
|
"ui.panel.lovelace.editor.strategy.areas.no_entities"
|
||||||
|
)}
|
||||||
</p>
|
</p>
|
||||||
`}
|
`}
|
||||||
</ha-expansion-panel>
|
</ha-expansion-panel>
|
||||||
|
@ -32,15 +32,6 @@ export const AREA_STRATEGY_GROUP_ICONS = {
|
|||||||
others: "mdi:shape",
|
others: "mdi:shape",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Todo be replace by translation when validated
|
|
||||||
export const AREA_STRATEGY_GROUP_LABELS = {
|
|
||||||
lights: "Lights",
|
|
||||||
climate: "Climate",
|
|
||||||
media_players: "Entertainment",
|
|
||||||
security: "Security",
|
|
||||||
others: "Others",
|
|
||||||
};
|
|
||||||
|
|
||||||
export type AreaStrategyGroup = (typeof AREA_STRATEGY_GROUPS)[number];
|
export type AreaStrategyGroup = (typeof AREA_STRATEGY_GROUPS)[number];
|
||||||
|
|
||||||
type AreaEntitiesByGroup = Record<AreaStrategyGroup, string[]>;
|
type AreaEntitiesByGroup = Record<AreaStrategyGroup, string[]>;
|
||||||
|
@ -6328,6 +6328,15 @@
|
|||||||
"strategy": {
|
"strategy": {
|
||||||
"original-states": {
|
"original-states": {
|
||||||
"helpers": "[%key:ui::panel::config::helpers::caption%]"
|
"helpers": "[%key:ui::panel::config::helpers::caption%]"
|
||||||
|
},
|
||||||
|
"areas": {
|
||||||
|
"groups": {
|
||||||
|
"lights": "Lights",
|
||||||
|
"climate": "Climate",
|
||||||
|
"media_players": "Entertainment",
|
||||||
|
"security": "Security",
|
||||||
|
"others": "Others"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cards": {
|
"cards": {
|
||||||
@ -7531,7 +7540,8 @@
|
|||||||
"url": "URL"
|
"url": "URL"
|
||||||
},
|
},
|
||||||
"areas": {
|
"areas": {
|
||||||
"areas_display": "Areas to display"
|
"areas_display": "Areas to display",
|
||||||
|
"no_entities": "No entities in this group, the section will not be displayed"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"view": {
|
"view": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user