mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Translations for domain names (#724)
This commit is contained in:
parent
c18247cd6b
commit
bf126b6c5e
@ -28,10 +28,6 @@
|
||||
.header .name {
|
||||
@apply(--paper-font-common-nowrap);
|
||||
}
|
||||
.header.domain .name {
|
||||
/* Capitalize cards titles for default domain groups. */
|
||||
text-transform: capitalize;
|
||||
}
|
||||
ha-entity-toggle {
|
||||
margin-left: 16px;
|
||||
}
|
||||
@ -66,7 +62,8 @@
|
||||
</dom-module>
|
||||
|
||||
<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 properties() {
|
||||
return {
|
||||
@ -75,23 +72,23 @@ class HaEntitiesCard extends window.hassMixins.EventsMixin(Polymer.Element) {
|
||||
groupEntity: Object,
|
||||
title: {
|
||||
type: String,
|
||||
computed: 'computeTitle(states, groupEntity)',
|
||||
computed: 'computeTitle(states, groupEntity, haLocalize)',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
computeTitle(states, groupEntity) {
|
||||
return groupEntity ?
|
||||
window.hassUtil.computeStateName(groupEntity).trim() :
|
||||
window.hassUtil.computeDomain(states[0]).replace(/_/g, ' ');
|
||||
computeTitle(states, groupEntity, haLocalize) {
|
||||
if (groupEntity) {
|
||||
return window.hassUtil.computeStateName(groupEntity).trim();
|
||||
}
|
||||
const domain = window.hassUtil.computeDomain(states[0]);
|
||||
return (haLocalize && haLocalize('domain', domain)) || domain.replace(/_/g, ' ');
|
||||
}
|
||||
|
||||
computeTitleClass(groupEntity) {
|
||||
let classes = 'header horizontal layout center ';
|
||||
if (groupEntity) {
|
||||
classes += 'more-info';
|
||||
} else {
|
||||
classes += 'domain';
|
||||
}
|
||||
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": {
|
||||
"config": "Configuration",
|
||||
"states": "Overview",
|
||||
|
Loading…
x
Reference in New Issue
Block a user