mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Translations for domain names (#724)
This commit is contained in:
parent
c18247cd6b
commit
bf126b6c5e
@ -28,10 +28,6 @@
|
|||||||
.header .name {
|
.header .name {
|
||||||
@apply(--paper-font-common-nowrap);
|
@apply(--paper-font-common-nowrap);
|
||||||
}
|
}
|
||||||
.header.domain .name {
|
|
||||||
/* Capitalize cards titles for default domain groups. */
|
|
||||||
text-transform: capitalize;
|
|
||||||
}
|
|
||||||
ha-entity-toggle {
|
ha-entity-toggle {
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
}
|
}
|
||||||
@ -66,7 +62,8 @@
|
|||||||
</dom-module>
|
</dom-module>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
class HaEntitiesCard extends window.hassMixins.EventsMixin(Polymer.Element) {
|
class HaEntitiesCard extends
|
||||||
|
window.hassMixins.LocalizeMixin(window.hassMixins.EventsMixin(Polymer.Element)) {
|
||||||
static get is() { return 'ha-entities-card'; }
|
static get is() { return 'ha-entities-card'; }
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
@ -75,23 +72,23 @@ class HaEntitiesCard extends window.hassMixins.EventsMixin(Polymer.Element) {
|
|||||||
groupEntity: Object,
|
groupEntity: Object,
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
computed: 'computeTitle(states, groupEntity)',
|
computed: 'computeTitle(states, groupEntity, haLocalize)',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
computeTitle(states, groupEntity) {
|
computeTitle(states, groupEntity, haLocalize) {
|
||||||
return groupEntity ?
|
if (groupEntity) {
|
||||||
window.hassUtil.computeStateName(groupEntity).trim() :
|
return window.hassUtil.computeStateName(groupEntity).trim();
|
||||||
window.hassUtil.computeDomain(states[0]).replace(/_/g, ' ');
|
}
|
||||||
|
const domain = window.hassUtil.computeDomain(states[0]);
|
||||||
|
return (haLocalize && haLocalize('domain', domain)) || domain.replace(/_/g, ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
computeTitleClass(groupEntity) {
|
computeTitleClass(groupEntity) {
|
||||||
let classes = 'header horizontal layout center ';
|
let classes = 'header horizontal layout center ';
|
||||||
if (groupEntity) {
|
if (groupEntity) {
|
||||||
classes += 'more-info';
|
classes += 'more-info';
|
||||||
} else {
|
|
||||||
classes += 'domain';
|
|
||||||
}
|
}
|
||||||
return classes;
|
return classes;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,41 @@
|
|||||||
{
|
{
|
||||||
|
"domain": {
|
||||||
|
"alarm_control_panel": "Alarm control panel",
|
||||||
|
"automation": "Automation",
|
||||||
|
"binary_sensor": "Binary sensor",
|
||||||
|
"calendar": "Calendar",
|
||||||
|
"camera": "Camera",
|
||||||
|
"climate": "Climate",
|
||||||
|
"configurator": "Configurator",
|
||||||
|
"conversation": "Conversation",
|
||||||
|
"cover": "Cover",
|
||||||
|
"device_tracker": "Device tracker",
|
||||||
|
"fan": "Fan",
|
||||||
|
"history_graph": "History graph",
|
||||||
|
"group": "Group",
|
||||||
|
"image_processing": "Image processing",
|
||||||
|
"input_boolean": "Input boolean",
|
||||||
|
"input_datetime": "Input datetime",
|
||||||
|
"input_select": "Input select",
|
||||||
|
"input_number": "Input number",
|
||||||
|
"input_text": "Input text",
|
||||||
|
"light": "Light",
|
||||||
|
"lock": "Lock",
|
||||||
|
"mailbox": "Mailbox",
|
||||||
|
"media_player": "Media player",
|
||||||
|
"notify": "Notify",
|
||||||
|
"plant": "Plant",
|
||||||
|
"proximity": "Proximity",
|
||||||
|
"remote": "Remote",
|
||||||
|
"scene": "Scene",
|
||||||
|
"script": "Script",
|
||||||
|
"sensor": "Sensor",
|
||||||
|
"sun": "Sun",
|
||||||
|
"switch": "Switch",
|
||||||
|
"updater": "Updater",
|
||||||
|
"weblink": "Weblink",
|
||||||
|
"zwave": "Z-Wave"
|
||||||
|
},
|
||||||
"panel": {
|
"panel": {
|
||||||
"config": "Configuration",
|
"config": "Configuration",
|
||||||
"states": "Overview",
|
"states": "Overview",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user