Add translations for the login form (#751)

This commit is contained in:
Adam Mills 2017-12-23 14:02:14 -05:00 committed by GitHub
parent e7df8cb195
commit 1b60a93fcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -7,6 +7,8 @@
<link rel="import" href="../../bower_components/paper-input/paper-input.html"> <link rel="import" href="../../bower_components/paper-input/paper-input.html">
<link rel="import" href="../../bower_components/paper-spinner/paper-spinner.html"> <link rel="import" href="../../bower_components/paper-spinner/paper-spinner.html">
<link rel='import' href='../../src/util/hass-mixins.html'>
<dom-module id="login-form"> <dom-module id="login-form">
<template> <template>
<style is="custom-style" include="iron-flex iron-positioning"></style> <style is="custom-style" include="iron-flex iron-positioning"></style>
@ -49,15 +51,15 @@
<div id='loginform' hidden$="[[showSpinner]]"> <div id='loginform' hidden$="[[showSpinner]]">
<paper-input <paper-input
id='passwordInput' id='passwordInput'
label='Password' label="[[localize('ui.login-form.password')]]"
type='password' type='password'
invalid='[[errorMessage]]' invalid='[[errorMessage]]'
error-message='[[errorMessage]]' error-message='[[errorMessage]]'
value='{{password}}' value='{{password}}'
></paper-input> ></paper-input>
<div class="layout horizontal center"> <div class="layout horizontal center">
<paper-checkbox for id='rememberLogin'>Remember</paper-checkbox> <paper-checkbox for id='rememberLogin'>[[localize('ui.login-form.remember')]]</paper-checkbox>
<paper-button on-tap='validatePassword'>Log In</paper-button> <paper-button on-tap='validatePassword'>[[localize('ui.login-form.log_in')]]</paper-button>
</div> </div>
</div> </div>
<div id="validatebox" hidden$="[[!showSpinner]]"> <div id="validatebox" hidden$="[[!showSpinner]]">
@ -70,7 +72,10 @@
</dom-module> </dom-module>
<script> <script>
class LoginForm extends Polymer.Element { /*
* @appliesMixin window.hassMixins.LocalizeMixin
*/
class LoginForm extends window.hassMixins.LocalizeMixin(Polymer.Element) {
static get is() { return 'login-form'; } static get is() { return 'login-form'; }
static get properties() { static get properties() {

View File

@ -283,6 +283,11 @@
"day": "{count} {count, plural,\n one {day}\n other {days}\n}", "day": "{count} {count, plural,\n one {day}\n other {days}\n}",
"week": "{count} {count, plural,\n one {week}\n other {weeks}\n}" "week": "{count} {count, plural,\n one {week}\n other {weeks}\n}"
}, },
"login-form": {
"password": "Password",
"remember": "Remember",
"log_in": "Log in"
},
"sidebar": { "sidebar": {
"developer_tools": "Developer tools", "developer_tools": "Developer tools",
"log_out": "Log out" "log_out": "Log out"