mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Minor form localizations (#19434)
* Minor form localizations * missing imports
This commit is contained in:
parent
7d4284d409
commit
83c5408f8f
@ -59,7 +59,7 @@ export class HaAuthFormString extends HaFormString {
|
||||
html`<div style="width: 24px"></div>`
|
||||
: this.schema.description?.suffix
|
||||
}
|
||||
.validationMessage=${this.schema.required ? "Required" : undefined}
|
||||
.validationMessage=${this.schema.required ? this.localize?.("ui.panel.page-authorize.form.error_required") : undefined}
|
||||
@input=${this._valueChanged}
|
||||
@change=${this._valueChanged}
|
||||
></ha-auth-textfield>
|
||||
|
@ -4,9 +4,12 @@ import { fireEvent } from "../../common/dom/fire_event";
|
||||
import type { HaTextField } from "../ha-textfield";
|
||||
import "../ha-textfield";
|
||||
import { HaFormElement, HaFormFloatData, HaFormFloatSchema } from "./types";
|
||||
import { LocalizeFunc } from "../../common/translations/localize";
|
||||
|
||||
@customElement("ha-form-float")
|
||||
export class HaFormFloat extends LitElement implements HaFormElement {
|
||||
@property({ attribute: false }) public localize?: LocalizeFunc;
|
||||
|
||||
@property({ attribute: false }) public schema!: HaFormFloatSchema;
|
||||
|
||||
@property({ attribute: false }) public data!: HaFormFloatData;
|
||||
@ -38,7 +41,9 @@ export class HaFormFloat extends LitElement implements HaFormElement {
|
||||
.required=${this.schema.required}
|
||||
.autoValidate=${this.schema.required}
|
||||
.suffix=${this.schema.description?.suffix}
|
||||
.validationMessage=${this.schema.required ? "Required" : undefined}
|
||||
.validationMessage=${this.schema.required
|
||||
? this.localize?.("ui.common.error_required")
|
||||
: undefined}
|
||||
@input=${this._valueChanged}
|
||||
></ha-textfield>
|
||||
`;
|
||||
|
@ -12,9 +12,12 @@ import { HaCheckbox } from "../ha-checkbox";
|
||||
import "../ha-slider";
|
||||
import { HaTextField } from "../ha-textfield";
|
||||
import { HaFormElement, HaFormIntegerData, HaFormIntegerSchema } from "./types";
|
||||
import { LocalizeFunc } from "../../common/translations/localize";
|
||||
|
||||
@customElement("ha-form-integer")
|
||||
export class HaFormInteger extends LitElement implements HaFormElement {
|
||||
@property({ attribute: false }) public localize?: LocalizeFunc;
|
||||
|
||||
@property({ attribute: false }) public schema!: HaFormIntegerSchema;
|
||||
|
||||
@property({ attribute: false }) public data?: HaFormIntegerData;
|
||||
@ -85,7 +88,9 @@ export class HaFormInteger extends LitElement implements HaFormElement {
|
||||
.required=${this.schema.required}
|
||||
.autoValidate=${this.schema.required}
|
||||
.suffix=${this.schema.description?.suffix}
|
||||
.validationMessage=${this.schema.required ? "Required" : undefined}
|
||||
.validationMessage=${this.schema.required
|
||||
? this.localize?.("ui.common.error_required")
|
||||
: undefined}
|
||||
@input=${this._valueChanged}
|
||||
></ha-textfield>
|
||||
`;
|
||||
|
@ -70,7 +70,9 @@ export class HaFormString extends LitElement implements HaFormElement {
|
||||
? // reserve some space for the icon.
|
||||
html`<div style="width: 24px"></div>`
|
||||
: this.schema.description?.suffix}
|
||||
.validationMessage=${this.schema.required ? "Required" : undefined}
|
||||
.validationMessage=${this.schema.required
|
||||
? this.localize?.("ui.common.error_required")
|
||||
: undefined}
|
||||
@input=${this._valueChanged}
|
||||
@change=${this._valueChanged}
|
||||
></ha-textfield>
|
||||
|
@ -5894,6 +5894,7 @@
|
||||
"previous": "Previous",
|
||||
"start_over": "Start over",
|
||||
"error": "Error: {error}",
|
||||
"error_required": "[%key:ui::common::error_required%]",
|
||||
"hide_password": "Hide password",
|
||||
"show_password": "Show password",
|
||||
"providers": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user