mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 04:46:34 +00:00
Translations for logbook/history panels (#741)
* Translations for logbook/history panels * Switch to base localize function * Move periods to generic durations keys These are going to end up part of a duration class of keys that will be more widely used.
This commit is contained in:
parent
1b66492db9
commit
097a8cfdc6
@ -18,6 +18,8 @@ const outDir = workDir + '/output';
|
||||
// should mirror the fragment definitions in polymer.json, so that we load
|
||||
// additional resources at equivalent points.
|
||||
const TRANSLATION_FRAGMENTS = [
|
||||
'history',
|
||||
'logbook',
|
||||
'shopping-list',
|
||||
];
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
<link rel="import" href="../../src/components/ha-menu-button.html">
|
||||
<link rel="import" href="../../src/data/ha-state-history-data.html">
|
||||
<link rel="import" href="../../src/resources/ha-style.html">
|
||||
<link rel='import' href='../../src/util/hass-mixins.html'>
|
||||
|
||||
<dom-module id="ha-panel-history">
|
||||
<template>
|
||||
@ -52,7 +53,7 @@
|
||||
<app-header slot="header" fixed>
|
||||
<app-toolbar>
|
||||
<ha-menu-button narrow='[[narrow]]' show-menu='[[showMenu]]'></ha-menu-button>
|
||||
<div main-title>History</div>
|
||||
<div main-title>[[localize('panel.history')]]</div>
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
|
||||
@ -61,22 +62,22 @@
|
||||
<vaadin-date-picker
|
||||
id='picker'
|
||||
value='{{_currentDate}}'
|
||||
label='Showing entries for'
|
||||
label="[[localize('ui.panel.history.showing_entries')]]"
|
||||
disabled='[[isLoadingData]]'
|
||||
></vaadin-date-picker>
|
||||
|
||||
<paper-dropdown-menu
|
||||
label-float
|
||||
label='Period'
|
||||
label="[[localize('ui.panel.history.period')]]"
|
||||
disabled='[[isLoadingData]]'
|
||||
>
|
||||
<paper-listbox
|
||||
slot="dropdown-content"
|
||||
selected="{{_periodIndex}}"
|
||||
>
|
||||
<paper-item>1 day</paper-item>
|
||||
<paper-item>3 days</paper-item>
|
||||
<paper-item>1 week</paper-item>
|
||||
<paper-item>[[localize('ui.duration.day', 'count', 1)]]</paper-item>
|
||||
<paper-item>[[localize('ui.duration.day', 'count', 3)]]</paper-item>
|
||||
<paper-item>[[localize('ui.duration.week', 'count', 1)]]</paper-item>
|
||||
</paper-listbox>
|
||||
</paper-dropdown-menu>
|
||||
</div>
|
||||
@ -91,7 +92,10 @@
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
class HaPanelHistory extends Polymer.Element {
|
||||
/*
|
||||
* @appliesMixin window.hassMixins.LocalizeMixin
|
||||
*/
|
||||
class HaPanelHistory extends window.hassMixins.LocalizeMixin(Polymer.Element) {
|
||||
static get is() { return 'ha-panel-history'; }
|
||||
|
||||
static get properties() {
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
<link rel="import" href="../../src/components/ha-menu-button.html">
|
||||
<link rel="import" href="../../src/resources/ha-style.html">
|
||||
<link rel='import' href='../../src/util/hass-mixins.html'>
|
||||
|
||||
<link rel="import" href="./ha-logbook.html">
|
||||
<link rel="import" href="./ha-logbook-data.html">
|
||||
@ -53,7 +54,7 @@
|
||||
<app-header slot="header" fixed>
|
||||
<app-toolbar>
|
||||
<ha-menu-button narrow='[[narrow]]' show-menu='[[showMenu]]'></ha-menu-button>
|
||||
<div main-title>Logbook</div>
|
||||
<div main-title>[[localize('panel.logbook')]]</div>
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
|
||||
@ -61,13 +62,13 @@
|
||||
<paper-spinner
|
||||
active='[[isLoading]]'
|
||||
hidden$='[[!isLoading]]'
|
||||
alt='Loading logbook entries'
|
||||
alt="[[localize('ui.common.loading')]]"
|
||||
></paper-spinner>
|
||||
|
||||
<vaadin-date-picker
|
||||
id='picker'
|
||||
value='{{_currentDate}}'
|
||||
label='Showing entries for'
|
||||
label="[[localize('ui.panel.logbook.showing_entries')]]"
|
||||
disabled='[[isLoading]]'
|
||||
></vaadin-date-picker>
|
||||
|
||||
@ -78,7 +79,10 @@
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
class HaPanelLogbook extends Polymer.Element {
|
||||
/*
|
||||
* @appliesMixin window.hassMixins.LocalizeMixin
|
||||
*/
|
||||
class HaPanelLogbook extends window.hassMixins.LocalizeMixin(Polymer.Element) {
|
||||
static get is() { return 'ha-panel-logbook'; }
|
||||
|
||||
static get properties() {
|
||||
|
@ -274,11 +274,25 @@
|
||||
}
|
||||
},
|
||||
"ui": {
|
||||
"common": {
|
||||
"loading": "Loading"
|
||||
},
|
||||
"duration": {
|
||||
"day": "{count} {count, plural,\n one {day}\n other {days}\n}",
|
||||
"week": "{count} {count, plural,\n one {week}\n other {weeks}\n}"
|
||||
},
|
||||
"sidebar": {
|
||||
"developer_tools": "Developer tools",
|
||||
"log_out": "Log out"
|
||||
},
|
||||
"panel": {
|
||||
"history": {
|
||||
"showing_entries": "Showing entries for",
|
||||
"period": "Period"
|
||||
},
|
||||
"logbook": {
|
||||
"showing_entries": "[%key:ui::panel::history::showing_entries%]"
|
||||
},
|
||||
"shopping-list": {
|
||||
"clear_completed": "Clear completed",
|
||||
"add_item": "Add item",
|
||||
|
Loading…
x
Reference in New Issue
Block a user