Add translation for script and scene card (#1119)

* Add translation for script and scene card

* appliesMixin

* Change script button text to "execute"
This commit is contained in:
c727 2018-04-23 19:25:49 +02:00 committed by Paulus Schoutsen
parent a22b62cf2a
commit 86db23a957
3 changed files with 18 additions and 4 deletions

View File

@ -5,6 +5,7 @@
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
<link rel="import" href="../components/entity/state-info.html">
<link rel='import' href='../util/hass-mixins.html'>
<dom-module id="state-card-scene">
<template>
@ -21,13 +22,16 @@
<div class='horizontal justified layout'>
<state-info state-obj="[[stateObj]]" in-dialog='[[inDialog]]'></state-info>
<paper-button on-click='activateScene'>ACTIVATE</paper-button>
<paper-button on-click='activateScene'>[[localize('ui.card.scene.activate')]]</paper-button>
</div>
</template>
</dom-module>
<script>
class StateCardScene extends Polymer.Element {
/*
* @appliesMixin window.hassMixins.LocalizeMixin
*/
class StateCardScene extends window.hassMixins.LocalizeMixin(Polymer.Element) {
static get is() { return 'state-card-scene'; }
static get properties() {

View File

@ -6,6 +6,7 @@
<link rel="import" href="../components/entity/state-info.html">
<link rel="import" href="../components/entity/ha-entity-toggle.html">
<link rel='import' href='../util/hass-mixins.html'>
<dom-module id="state-card-script">
<template>
@ -30,14 +31,17 @@
<ha-entity-toggle state-obj='[[stateObj]]' hass='[[hass]]'></ha-entity-toggle>
</template>
<template is='dom-if' if='[[!stateObj.attributes.can_cancel]]'>
<paper-button on-click='fireScript'>ACTIVATE</paper-button>
<paper-button on-click='fireScript'>[[localize('ui.card.script.execute')]]</paper-button>
</template>
</div>
</template>
</dom-module>
<script>
class StateCardScript extends Polymer.Element {
/*
* @appliesMixin window.hassMixins.LocalizeMixin
*/
class StateCardScript extends window.hassMixins.LocalizeMixin(Polymer.Element) {
static get is() { return 'state-card-script'; }
static get properties() {

View File

@ -311,6 +311,12 @@
},
"persistent_notification": {
"dismiss": "Dismiss"
},
"scene": {
"activate": "Activate"
},
"script": {
"execute": "Execute"
}
},
"common": {