From 93df473ad2df0d4ca64b29e54e054f5ce3a27e98 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Wed, 25 Jun 2025 18:18:29 +0300 Subject: [PATCH] Translate select options in config flows (#25911) --- src/components/ha-form/ha-form-select.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/ha-form/ha-form-select.ts b/src/components/ha-form/ha-form-select.ts index 8451b21a6c..5ccb28ba84 100644 --- a/src/components/ha-form/ha-form-select.ts +++ b/src/components/ha-form/ha-form-select.ts @@ -24,12 +24,16 @@ export class HaFormSelect extends LitElement implements HaFormElement { @property() public helper?: string; + @property({ attribute: false }) + public localizeValue?: (key: string) => string; + @property({ type: Boolean }) public disabled = false; private _selectSchema = memoizeOne( - (options): SelectSelector => ({ + (schema: HaFormSelectSchema): SelectSelector => ({ select: { - options: options.map((option) => ({ + translation_key: schema.name, + options: schema.options.map((option) => ({ value: option[0], label: option[1], })), @@ -41,13 +45,13 @@ export class HaFormSelect extends LitElement implements HaFormElement { return html` `;