From 708ab2ed6913f8a9c3921de3616948c20ac3e703 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Fri, 10 Nov 2023 09:12:36 -0800 Subject: [PATCH] Localize hide/show password (#18607) --- src/components/ha-form/ha-form-string.ts | 9 ++++++++- src/components/ha-selector/ha-selector-text.ts | 6 +++++- src/translations/en.json | 4 ++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/ha-form/ha-form-string.ts b/src/components/ha-form/ha-form-string.ts index d7d4236bbc5e..8a7ec104923d 100644 --- a/src/components/ha-form/ha-form-string.ts +++ b/src/components/ha-form/ha-form-string.ts @@ -19,11 +19,14 @@ import type { HaFormStringData, HaFormStringSchema, } from "./types"; +import { HomeAssistant } from "../../types"; const MASKED_FIELDS = ["password", "secret", "token"]; @customElement("ha-form-string") export class HaFormString extends LitElement implements HaFormElement { + @property() public hass!: HomeAssistant; + @property() public schema!: HaFormStringSchema; @property() public data!: HaFormStringData; @@ -78,7 +81,11 @@ export class HaFormString extends LitElement implements HaFormElement { return html` diff --git a/src/components/ha-selector/ha-selector-text.ts b/src/components/ha-selector/ha-selector-text.ts index c3e2b969e4ff..89f764f626e8 100644 --- a/src/components/ha-selector/ha-selector-text.ts +++ b/src/components/ha-selector/ha-selector-text.ts @@ -76,7 +76,11 @@ export class HaTextSelector extends LitElement { ${this.selector.text?.type === "password" ? html`` diff --git a/src/translations/en.json b/src/translations/en.json index 566fedce9640..20e3ad35d3e3 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -328,6 +328,10 @@ "file": { "upload_failed": "Upload failed", "unknown_file": "Unknown file" + }, + "text": { + "show_password": "Show password", + "hide_password": "Hide password" } }, "logbook": {