mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 21:36:36 +00:00
Add translate tags to "cards" (#818)
* Add translate tags to "cards" affected cards: - camera card - persistent notification - weather * Add translate tags to "cards" code style * Add translate tags to "cards" changes from code review
This commit is contained in:
parent
8649c5352b
commit
50ed7678a1
@ -44,7 +44,7 @@
|
|||||||
<div class='caption'>
|
<div class='caption'>
|
||||||
[[computeStateName(stateObj)]]
|
[[computeStateName(stateObj)]]
|
||||||
<template is='dom-if' if='[[!imageLoaded]]'>
|
<template is='dom-if' if='[[!imageLoaded]]'>
|
||||||
(Image not available)
|
([[localize('ui.card.camera.not_available')]])
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -54,7 +54,8 @@
|
|||||||
{
|
{
|
||||||
const UPDATE_INTERVAL = 10000; // ms
|
const UPDATE_INTERVAL = 10000; // ms
|
||||||
|
|
||||||
class HaCameraCard extends window.hassMixins.EventsMixin(Polymer.Element) {
|
class HaCameraCard extends
|
||||||
|
window.hassMixins.LocalizeMixin(window.hassMixins.EventsMixin(Polymer.Element)) {
|
||||||
static get is() { return 'ha-camera-card'; }
|
static get is() { return 'ha-camera-card'; }
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
<link rel='import' href='../components/ha-card.html'>
|
<link rel='import' href='../components/ha-card.html'>
|
||||||
<link rel='import' href='../components/ha-markdown.html'>
|
<link rel='import' href='../components/ha-markdown.html'>
|
||||||
|
|
||||||
|
<link rel='import' href='../util/hass-mixins.html'>
|
||||||
|
|
||||||
<dom-module id='ha-persistent_notification-card'>
|
<dom-module id='ha-persistent_notification-card'>
|
||||||
<template>
|
<template>
|
||||||
<style>
|
<style>
|
||||||
@ -37,13 +39,13 @@
|
|||||||
|
|
||||||
<ha-card header='[[computeTitle(stateObj)]]'>
|
<ha-card header='[[computeTitle(stateObj)]]'>
|
||||||
<ha-markdown content='[[stateObj.attributes.message]]'></ha-markdown>
|
<ha-markdown content='[[stateObj.attributes.message]]'></ha-markdown>
|
||||||
<paper-button on-tap='dismissTap'>DISMISS</paper-button>
|
<paper-button on-tap='dismissTap'>[[localize('ui.card.persistent_notification.dismiss')]]</paper-button>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
</template>
|
</template>
|
||||||
</dom-module>
|
</dom-module>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
class HaPersistentNotificationCard extends Polymer.Element {
|
class HaPersistentNotificationCard extends window.hassMixins.LocalizeMixin(Polymer.Element) {
|
||||||
static get is() { return 'ha-persistent_notification-card'; }
|
static get is() { return 'ha-persistent_notification-card'; }
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
<link rel='import' href='../../bower_components/iron-flex-layout/iron-flex-layout-classes.html'>
|
<link rel='import' href='../../bower_components/iron-flex-layout/iron-flex-layout-classes.html'>
|
||||||
<link rel='import' href='../../bower_components/google-apis/google-legacy-loader.html'>
|
<link rel='import' href='../../bower_components/google-apis/google-legacy-loader.html'>
|
||||||
<link rel='import' href='../components/ha-card.html'>
|
<link rel='import' href='../components/ha-card.html'>
|
||||||
|
|
||||||
|
<link rel='import' href='../util/hass-mixins.html'>
|
||||||
|
|
||||||
<dom-module id='ha-weather-card'>
|
<dom-module id='ha-weather-card'>
|
||||||
<template>
|
<template>
|
||||||
<style>
|
<style>
|
||||||
@ -48,17 +51,17 @@
|
|||||||
<div class='cond condtemp'>[[attr.temperature]]°</div>
|
<div class='cond condtemp'>[[attr.temperature]]°</div>
|
||||||
<div class='cond conddetails'>
|
<div class='cond conddetails'>
|
||||||
<div class="condsmall" hidden$="[[!attr.wind_speed]]">
|
<div class="condsmall" hidden$="[[!attr.wind_speed]]">
|
||||||
Wind:
|
[[localize('attribute.weather.wind_speed')]]:
|
||||||
<span hidden$="[[!attr.wind_speed]]">
|
<span hidden$="[[!attr.wind_speed]]">
|
||||||
[[attr.wind_speed]]
|
[[attr.wind_speed]]
|
||||||
</span>
|
</span>
|
||||||
<span hidden$="[[!windBearing]]">[[windBearing]]</span>
|
<span hidden$="[[!windBearing]]">[[windBearing]]</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="condsmall" hidden$="[[!attr.humidity]]">
|
<div class="condsmall" hidden$="[[!attr.humidity]]">
|
||||||
Humidity: [[attr.humidity]]%
|
[[localize('attribute.weather.humidity')]]: [[attr.humidity]]%
|
||||||
</div>
|
</div>
|
||||||
<div class="condsmall" hidden$="[[!attr.visibility]]">
|
<div class="condsmall" hidden$="[[!attr.visibility]]">
|
||||||
Visibility: [[attr.visibility]]
|
[[localize('attribute.weather.visibility')]]: [[attr.visibility]]
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='clear'></div>
|
<div class='clear'></div>
|
||||||
@ -93,7 +96,7 @@
|
|||||||
'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N'
|
'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N'
|
||||||
];
|
];
|
||||||
|
|
||||||
class HaWeatherCard extends Polymer.Element {
|
class HaWeatherCard extends window.hassMixins.LocalizeMixin(Polymer.Element) {
|
||||||
static get is() { return 'ha-weather-card'; }
|
static get is() { return 'ha-weather-card'; }
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
{
|
{
|
||||||
|
"attribute": {
|
||||||
|
"weather": {
|
||||||
|
"humidity": "Humidity",
|
||||||
|
"visibility": "Visibility",
|
||||||
|
"wind_speed": "Wind speed"
|
||||||
|
}
|
||||||
|
},
|
||||||
"domain": {
|
"domain": {
|
||||||
"alarm_control_panel": "Alarm control panel",
|
"alarm_control_panel": "Alarm control panel",
|
||||||
"automation": "Automation",
|
"automation": "Automation",
|
||||||
@ -294,6 +301,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ui": {
|
"ui": {
|
||||||
|
"card": {
|
||||||
|
"camera": {
|
||||||
|
"not_available": "Image not available"
|
||||||
|
},
|
||||||
|
"persistent_notification": {
|
||||||
|
"dismiss": "Dismiss"
|
||||||
|
}
|
||||||
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"loading": "Loading",
|
"loading": "Loading",
|
||||||
"cancel": "Cancel"
|
"cancel": "Cancel"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user