File tree Expand file tree Collapse file tree 4 files changed +26
-19
lines changed Expand file tree Collapse file tree 4 files changed +26
-19
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import {loadHaComponents} from "../functions/hacks";
77import { CardConfig , EntitiesRowConfig } from "../structs/config" ;
88import { HomeAssistant } from "custom-card-helpers" ;
99import { setHass } from "../globals" ;
10+ import localize from "../localization/localize" ;
1011
1112const FORM_SCHEMA = [
1213 {
@@ -117,19 +118,6 @@ export class TodayCardEditor extends LitElement {
117118 }
118119
119120 private computeLabel ( schema : Record < string , unknown > ) : string {
120- switch ( schema . name ) {
121- case "title" :
122- return "Title" ;
123- case "advance" :
124- return "Advance (optional)" ;
125- case "show_all_day_events" :
126- return "Show all day events" ;
127- case "show_past_events" :
128- return "Show past events" ;
129- case "temp_color" :
130- return "Fallback color" ;
131- default :
132- return "" ;
133- }
121+ return localize ( `config.label.${ schema . name } ` ) ;
134122 } ;
135123}
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import {repeat} from "lit/directives/repeat";
66import { fireEvent } from "../functions/config" ;
77import { HomeAssistant } from "custom-card-helpers" ;
88import { EntitiesRowConfig } from "../structs/config" ;
9+ import localize from "../localization/localize" ;
910
1011@customElement ( 'today-card-entities-editor' )
1112export class TodayCardEntitiesEditor extends LitElement {
@@ -22,9 +23,7 @@ export class TodayCardEntitiesEditor extends LitElement {
2223 }
2324
2425 return html `
25- < h3 >
26- Entities (required)
27- </ h3 >
26+ < h3 > ${ localize ( 'config.label.entities' ) } </ h3 >
2827 < div class ="entities ">
2928 ${ repeat (
3029 this . entities ,
@@ -38,15 +37,15 @@ export class TodayCardEntitiesEditor extends LitElement {
3837 < ha-color-picker
3938 class ="color-picker "
4039 .hass =${ this . hass }
41- .label ="Color"
40+ .label =${ localize ( 'config.label.color' ) }
4241 .value=${ entity . color ?? "" }
4342 .includeNone=${ true }
4443 .includeState=${ false }
4544 .index=${ index }
4645 @value-changed=${ this . changeColor }
4746 > </ ha-color-picker >
4847 < ha-icon-button
49- .label =" Clear "
48+ .label =${ localize ( 'config.label.clear' ) }
5049 .path =${ mdiClose }
5150 class="remove-icon"
5251 .index=${ index }
Original file line number Diff line number Diff line change 1313 "config" : {
1414 "stub" : {
1515 "title" : " Heutiger Terminplan"
16+ },
17+ "label" : {
18+ "title" : " Titel" ,
19+ "advance" : " Vorlauf (optional)" ,
20+ "fallback_color" : " Standard-Farbe" ,
21+ "show_all_day_events" : " Zeige ganztägige Termine" ,
22+ "show_past_events" : " Zeige vergangene Termine" ,
23+ "entities" : " Entitäten (benötigt)" ,
24+ "color" : " Farbe" ,
25+ "clear" : " Entfernen"
1626 }
1727 }
1828}
Original file line number Diff line number Diff line change 1313 "config" : {
1414 "stub" : {
1515 "title" : " Today's Schedule"
16+ },
17+ "label" : {
18+ "title" : " Title" ,
19+ "advance" : " Advance (optional)" ,
20+ "fallback_color" : " Fallback Color" ,
21+ "show_all_day_events" : " Show all day events" ,
22+ "show_past_events" : " Show past events" ,
23+ "entities" : " Entities (required)" ,
24+ "color" : " Color" ,
25+ "clear" : " Clear"
1626 }
1727 }
1828}
You can’t perform that action at this time.
0 commit comments