diff --git a/demo/src/custom-cards/ha-demo-card.ts b/demo/src/custom-cards/ha-demo-card.ts index 92f1731b71e8..951a072859e7 100644 --- a/demo/src/custom-cards/ha-demo-card.ts +++ b/demo/src/custom-cards/ha-demo-card.ts @@ -48,8 +48,7 @@ export class HADemoCard extends LitElement implements LovelaceCard { ${this.hass.localize( "ui.panel.page-demo.cards.demo.demo_by", - "name", - conf.authorName + { name: conf.authorName } )} diff --git a/hassio/src/addon-store/hassio-addon-repository.ts b/hassio/src/addon-store/hassio-addon-repository.ts index 728668ebd9ec..cd0e1d234da4 100644 --- a/hassio/src/addon-store/hassio-addon-repository.ts +++ b/hassio/src/addon-store/hassio-addon-repository.ts @@ -49,11 +49,9 @@ export class HassioAddonRepositoryEl extends LitElement { return html`

- ${this.supervisor.localize( - "store.no_results_found", - "repository", - repo.name - )} + ${this.supervisor.localize("store.no_results_found", { + repository: repo.name, + })}

`; diff --git a/hassio/src/addon-view/config/hassio-addon-config.ts b/hassio/src/addon-view/config/hassio-addon-config.ts index 59c0e3fc63d5..ceb56cbd758b 100644 --- a/hassio/src/addon-view/config/hassio-addon-config.ts +++ b/hassio/src/addon-view/config/hassio-addon-config.ts @@ -340,11 +340,9 @@ class HassioAddonConfig extends LitElement { }; fireEvent(this, "hass-api-called", eventdata); } catch (err: any) { - this._error = this.supervisor.localize( - "addon.failed_to_reset", - "error", - extractApiErrorMessage(err) - ); + this._error = this.supervisor.localize("addon.failed_to_reset", { + error: extractApiErrorMessage(err), + }); } button.progress = false; } @@ -381,11 +379,9 @@ class HassioAddonConfig extends LitElement { await suggestAddonRestart(this, this.hass, this.supervisor, this.addon); } } catch (err: any) { - this._error = this.supervisor.localize( - "addon.failed_to_save", - "error", - extractApiErrorMessage(err) - ); + this._error = this.supervisor.localize("addon.failed_to_save", { + error: extractApiErrorMessage(err), + }); eventdata.success = false; } button.progress = false; diff --git a/hassio/src/addon-view/config/hassio-addon-network.ts b/hassio/src/addon-view/config/hassio-addon-network.ts index 0e315bbf113e..56173ab5f55e 100644 --- a/hassio/src/addon-view/config/hassio-addon-network.ts +++ b/hassio/src/addon-view/config/hassio-addon-network.ts @@ -180,11 +180,9 @@ class HassioAddonNetwork extends LitElement { await suggestAddonRestart(this, this.hass, this.supervisor, this.addon); } } catch (err: any) { - this._error = this.supervisor.localize( - "addon.failed_to_reset", - "error", - extractApiErrorMessage(err) - ); + this._error = this.supervisor.localize("addon.failed_to_reset", { + error: extractApiErrorMessage(err), + }); button.actionError(); } } @@ -220,11 +218,9 @@ class HassioAddonNetwork extends LitElement { await suggestAddonRestart(this, this.hass, this.supervisor, this.addon); } } catch (err: any) { - this._error = this.supervisor.localize( - "addon.failed_to_save", - "error", - extractApiErrorMessage(err) - ); + this._error = this.supervisor.localize("addon.failed_to_save", { + error: extractApiErrorMessage(err), + }); button.actionError(); } } diff --git a/hassio/src/addon-view/documentation/hassio-addon-documentation-tab.ts b/hassio/src/addon-view/documentation/hassio-addon-documentation-tab.ts index 98cd11b27615..905b21ea3634 100644 --- a/hassio/src/addon-view/documentation/hassio-addon-documentation-tab.ts +++ b/hassio/src/addon-view/documentation/hassio-addon-documentation-tab.ts @@ -85,8 +85,7 @@ class HassioAddonDocumentationDashboard extends LitElement { } catch (err: any) { this._error = this.supervisor.localize( "addon.documentation.get_documentation", - "error", - extractApiErrorMessage(err) + { error: extractApiErrorMessage(err) } ); } } diff --git a/hassio/src/addon-view/info/hassio-addon-info.ts b/hassio/src/addon-view/info/hassio-addon-info.ts index fee934072071..7a935518cc32 100644 --- a/hassio/src/addon-view/info/hassio-addon-info.ts +++ b/hassio/src/addon-view/info/hassio-addon-info.ts @@ -401,13 +401,14 @@ class HassioAddonInfo extends LitElement {
${this.addon.description}.
- ${this.supervisor.localize( - "addon.dashboard.visit_addon_page", - "name", - html`${this.addon.name}` - )} + >`, + })}
@@ -574,10 +575,10 @@ class HassioAddonInfo extends LitElement { ${this.supervisor.localize( "addon.dashboard.not_available_version", - "core_version_installed", - this.supervisor.core.version, - "core_version_needed", - addonStoreInfo!.homeassistant + { + core_version_installed: this.supervisor.core.version, + core_version_needed: addonStoreInfo!.homeassistant, + } )} ` @@ -750,12 +751,11 @@ class HassioAddonInfo extends LitElement { id === "stage" ? this.supervisor.localize( `addon.dashboard.capability.${id}.description`, - "icon_stable", - ``, - "icon_experimental", - ``, - "icon_deprecated", - `` + { + icon_stable: ``, + icon_experimental: ``, + icon_deprecated: ``, + } ) : this.supervisor.localize( `addon.dashboard.capability.${id}.description` @@ -817,11 +817,9 @@ class HassioAddonInfo extends LitElement { }; fireEvent(this, "hass-api-called", eventdata); } catch (err: any) { - this._error = this.supervisor.localize( - "addon.failed_to_save", - "error", - extractApiErrorMessage(err) - ); + this._error = this.supervisor.localize("addon.failed_to_save", { + error: extractApiErrorMessage(err), + }); } } @@ -839,11 +837,9 @@ class HassioAddonInfo extends LitElement { }; fireEvent(this, "hass-api-called", eventdata); } catch (err: any) { - this._error = this.supervisor.localize( - "addon.failed_to_save", - "error", - extractApiErrorMessage(err) - ); + this._error = this.supervisor.localize("addon.failed_to_save", { + error: extractApiErrorMessage(err), + }); } } @@ -861,11 +857,9 @@ class HassioAddonInfo extends LitElement { }; fireEvent(this, "hass-api-called", eventdata); } catch (err: any) { - this._error = this.supervisor.localize( - "addon.failed_to_save", - "error", - extractApiErrorMessage(err) - ); + this._error = this.supervisor.localize("addon.failed_to_save", { + error: extractApiErrorMessage(err), + }); } } @@ -883,11 +877,9 @@ class HassioAddonInfo extends LitElement { }; fireEvent(this, "hass-api-called", eventdata); } catch (err: any) { - this._error = this.supervisor.localize( - "addon.failed_to_save", - "error", - extractApiErrorMessage(err) - ); + this._error = this.supervisor.localize("addon.failed_to_save", { + error: extractApiErrorMessage(err), + }); } } @@ -905,11 +897,9 @@ class HassioAddonInfo extends LitElement { }; fireEvent(this, "hass-api-called", eventdata); } catch (err: any) { - this._error = this.supervisor.localize( - "addon.failed_to_save", - "error", - extractApiErrorMessage(err) - ); + this._error = this.supervisor.localize("addon.failed_to_save", { + error: extractApiErrorMessage(err), + }); } } diff --git a/hassio/src/addon-view/log/hassio-addon-logs.ts b/hassio/src/addon-view/log/hassio-addon-logs.ts index 2dc96453ffb1..c2cd53f962fc 100644 --- a/hassio/src/addon-view/log/hassio-addon-logs.ts +++ b/hassio/src/addon-view/log/hassio-addon-logs.ts @@ -72,11 +72,9 @@ class HassioAddonLogs extends LitElement { try { this._content = await fetchHassioAddonLogs(this.hass, this.addon.slug); } catch (err: any) { - this._error = this.supervisor.localize( - "addon.logs.get_logs", - "error", - extractApiErrorMessage(err) - ); + this._error = this.supervisor.localize("addon.logs.get_logs", { + error: extractApiErrorMessage(err), + }); } } diff --git a/hassio/src/backups/hassio-backups.ts b/hassio/src/backups/hassio-backups.ts index 80282aa7d6ad..943e6e6c646b 100644 --- a/hassio/src/backups/hassio-backups.ts +++ b/hassio/src/backups/hassio-backups.ts @@ -360,11 +360,9 @@ export class HassioBackups extends LitElement { if (this.supervisor!.info.state !== "running") { showAlertDialog(this, { title: this.supervisor!.localize("backup.could_not_create"), - text: this.supervisor!.localize( - "backup.create_blocked_not_running", - "state", - this.supervisor!.info.state - ), + text: this.supervisor!.localize("backup.create_blocked_not_running", { + state: this.supervisor!.info.state, + }), }); return; } diff --git a/hassio/src/dashboard/hassio-update.ts b/hassio/src/dashboard/hassio-update.ts index 9ef61c43f30e..3307f21427ce 100644 --- a/hassio/src/dashboard/hassio-update.ts +++ b/hassio/src/dashboard/hassio-update.ts @@ -46,11 +46,9 @@ export class HassioUpdate extends LitElement { return html`

- ${this.supervisor.localize( - "common.update_available", - "count", - updatesAvailable - )} + ${this.supervisor.localize("common.update_available", { + count: updatesAvailable, + })} 🎉

diff --git a/hassio/src/dialogs/backup/dialog-hassio-create-backup.ts b/hassio/src/dialogs/backup/dialog-hassio-create-backup.ts index da0bbdbef6e0..3e1fd79a3df1 100644 --- a/hassio/src/dialogs/backup/dialog-hassio-create-backup.ts +++ b/hassio/src/dialogs/backup/dialog-hassio-create-backup.ts @@ -89,8 +89,7 @@ class HassioCreateBackupDialog extends LitElement { ), text: this._dialogParams!.supervisor.localize( "backup.create_blocked_not_running", - "state", - this._dialogParams!.supervisor.info.state + { state: this._dialogParams!.supervisor.info.state } ), }); return; diff --git a/hassio/src/dialogs/network/dialog-hassio-network.ts b/hassio/src/dialogs/network/dialog-hassio-network.ts index f3a77f8b40a6..182efad690e0 100644 --- a/hassio/src/dialogs/network/dialog-hassio-network.ts +++ b/hassio/src/dialogs/network/dialog-hassio-network.ts @@ -145,8 +145,7 @@ export class DialogHassioNetwork ? html`

${this.supervisor.localize( "dialog.network.connected_to", - "ssid", - this._interface?.wifi?.ssid + { ssid: this._interface?.wifi?.ssid } )}

` : ""} diff --git a/hassio/src/hassio-my-redirect.ts b/hassio/src/hassio-my-redirect.ts index 71bc873eb61d..0640d4820fca 100644 --- a/hassio/src/hassio-my-redirect.ts +++ b/hassio/src/hassio-my-redirect.ts @@ -76,17 +76,15 @@ class HassioMyRedirect extends LitElement { const redirect = REDIRECTS[path]; if (!redirect) { - this._error = this.supervisor.localize( - "my.not_supported", - "link", - html` ${this.supervisor.localize("my.faq_link")} - ` - ); + `, + }); return; } diff --git a/hassio/src/system/hassio-core-info.ts b/hassio/src/system/hassio-core-info.ts index 7754728757e2..f005700b17cc 100644 --- a/hassio/src/system/hassio-core-info.ts +++ b/hassio/src/system/hassio-core-info.ts @@ -96,13 +96,11 @@ class HassioCoreInfo extends LitElement { slot="primaryAction" class="warning" @click=${this._coreRestart} - .title=${this.supervisor.localize( - "common.restart_name", - "name", - "Core" - )} + .title=${this.supervisor.localize("common.restart_name", { + name: "Core", + })} > - ${this.supervisor.localize("common.restart_name", "name", "Core")} + ${this.supervisor.localize("common.restart_name", { name: "Core" })}
@@ -122,16 +120,12 @@ class HassioCoreInfo extends LitElement { button.progress = true; const confirmed = await showConfirmationDialog(this, { - title: this.supervisor.localize( - "confirm.restart.title", - "name", - "Home Assistant Core" - ), - text: this.supervisor.localize( - "confirm.restart.text", - "name", - "Home Assistant Core" - ), + title: this.supervisor.localize("confirm.restart.title", { + name: "Home Assistant Core", + }), + text: this.supervisor.localize("confirm.restart.text", { + name: "Home Assistant Core", + }), confirmText: this.supervisor.localize("common.restart"), dismissText: this.supervisor.localize("common.cancel"), }); @@ -146,11 +140,9 @@ class HassioCoreInfo extends LitElement { } catch (err: any) { if (this.hass.connection.connected) { showAlertDialog(this, { - title: this.supervisor.localize( - "common.failed_to_restart_name", - "name", - "Home AssistantCore" - ), + title: this.supervisor.localize("common.failed_to_restart_name", { + name: "Home Assistant Core", + }), text: extractApiErrorMessage(err), }); } diff --git a/hassio/src/system/hassio-supervisor-info.ts b/hassio/src/system/hassio-supervisor-info.ts index d083bfb613ec..c025fce6cd4f 100644 --- a/hassio/src/system/hassio-supervisor-info.ts +++ b/hassio/src/system/hassio-supervisor-info.ts @@ -200,17 +200,13 @@ class HassioSupervisorInfo extends LitElement { - ${this.supervisor.localize( - "common.restart_name", - "name", - "Supervisor" - )} + ${this.supervisor.localize("common.restart_name", { + name: "Supervisor", + })}
@@ -292,16 +288,12 @@ class HassioSupervisorInfo extends LitElement { button.progress = true; const confirmed = await showConfirmationDialog(this, { - title: this.supervisor.localize( - "confirm.restart.title", - "name", - "Supervisor" - ), - text: this.supervisor.localize( - "confirm.restart.text", - "name", - "Supervisor" - ), + title: this.supervisor.localize("confirm.restart.title", { + name: "Supervisor", + }), + text: this.supervisor.localize("confirm.restart.text", { + name: "Supervisor", + }), confirmText: this.supervisor.localize("common.restart"), dismissText: this.supervisor.localize("common.cancel"), }); @@ -315,11 +307,9 @@ class HassioSupervisorInfo extends LitElement { await restartSupervisor(this.hass); } catch (err: any) { showAlertDialog(this, { - title: this.supervisor.localize( - "common.failed_to_restart_name", - "name", - "Supervisor" - ), + title: this.supervisor.localize("common.failed_to_restart_name", { + name: "Supervisor", + }), text: extractApiErrorMessage(err), }); } finally { @@ -334,8 +324,7 @@ class HassioSupervisorInfo extends LitElement { ), text: this.supervisor.localize( "system.supervisor.share_diagonstics_description", - "line_break", - html`

` + { line_break: html`

` } ), }); } diff --git a/hassio/src/system/hassio-supervisor-log.ts b/hassio/src/system/hassio-supervisor-log.ts index fec60d6d034f..a2e1d1d75e1e 100644 --- a/hassio/src/system/hassio-supervisor-log.ts +++ b/hassio/src/system/hassio-supervisor-log.ts @@ -124,13 +124,10 @@ class HassioSupervisorLog extends LitElement { this._selectedLogProvider ); } catch (err: any) { - this._error = this.supervisor.localize( - "system.log.get_logs", - "provider", - this._selectedLogProvider, - "error", - extractApiErrorMessage(err) - ); + this._error = this.supervisor.localize("system.log.get_logs", { + provider: this._selectedLogProvider, + error: extractApiErrorMessage(err), + }); } } diff --git a/src/auth/ha-auth-flow.ts b/src/auth/ha-auth-flow.ts index f23733bb79f5..e0841ebe3803 100644 --- a/src/auth/ha-auth-flow.ts +++ b/src/auth/ha-auth-flow.ts @@ -159,11 +159,9 @@ export class HaAuthFlow extends LitElement { case "error": return html` - ${this.localize( - "ui.panel.page-authorize.form.error", - "error", - this._errorMessage - )} + ${this.localize("ui.panel.page-authorize.form.error", { + error: this._errorMessage, + })}
@@ -317,15 +315,10 @@ export class HaAuthFlow extends LitElement { } private _computeStepDescription(step: DataEntryFlowStepForm) { - const resourceKey = - `ui.panel.page-authorize.form.providers.${step.handler[0]}.step.${step.step_id}.description` as const; - const args: string[] = []; - const placeholders = step.description_placeholders || {}; - Object.keys(placeholders).forEach((key) => { - args.push(key); - args.push(placeholders[key]); - }); - return this.localize(resourceKey, ...args); + return this.localize( + `ui.panel.page-authorize.form.providers.${step.handler[0]}.step.${step.step_id}.description`, + step.description_placeholders + ); } private _computeLabelCallback(step: DataEntryFlowStepForm) { diff --git a/src/common/structs/handle-errors.ts b/src/common/structs/handle-errors.ts index 96c82081c565..ad5cb080d94f 100644 --- a/src/common/structs/handle-errors.ts +++ b/src/common/structs/handle-errors.ts @@ -13,45 +13,33 @@ export const handleStructError = ( for (const failure of err.failures()) { if (failure.value === undefined) { errors.push( - hass.localize( - "ui.errors.config.key_missing", - "key", - failure.path.join(".") - ) + hass.localize("ui.errors.config.key_missing", { + key: failure.path.join("."), + }) ); } else if (failure.type === "never") { warnings.push( - hass.localize( - "ui.errors.config.key_not_expected", - "key", - failure.path.join(".") - ) + hass.localize("ui.errors.config.key_not_expected", { + key: failure.path.join("."), + }) ); } else if (failure.type === "union") { continue; } else if (failure.type === "enums") { warnings.push( - hass.localize( - "ui.errors.config.key_wrong_type", - "key", - failure.path.join("."), - "type_correct", - failure.message.replace("Expected ", "").split(", ")[0], - "type_wrong", - JSON.stringify(failure.value) - ) + hass.localize("ui.errors.config.key_wrong_type", { + key: failure.path.join("."), + type_correct: failure.message.replace("Expected ", "").split(", ")[0], + type_wrong: JSON.stringify(failure.value), + }) ); } else { warnings.push( - hass.localize( - "ui.errors.config.key_wrong_type", - "key", - failure.path.join("."), - "type_correct", - failure.refinement || failure.type, - "type_wrong", - JSON.stringify(failure.value) - ) + hass.localize("ui.errors.config.key_wrong_type", { + key: failure.path.join("."), + type_correct: failure.refinement || failure.type, + type_wrong: JSON.stringify(failure.value), + }) ); } } diff --git a/src/components/ha-button-related-filter-menu.ts b/src/components/ha-button-related-filter-menu.ts index c83bdcdd6cb8..0225f77cab99 100644 --- a/src/components/ha-button-related-filter-menu.ts +++ b/src/components/ha-button-related-filter-menu.ts @@ -126,8 +126,11 @@ export class HaRelatedFilterButtonMenu extends LitElement { } const filter = this.hass.localize( "ui.components.related-filter-menu.filtered_by_entity", - "entity_name", - computeStateName((ev.currentTarget as any).comboBox.selectedItem) + { + entity_name: computeStateName( + (ev.currentTarget as any).comboBox.selectedItem + ), + } ); const items = await findRelated(this.hass, "entity", entityId); fireEvent(this, "related-changed", { @@ -146,11 +149,12 @@ export class HaRelatedFilterButtonMenu extends LitElement { } const filter = this.hass.localize( "ui.components.related-filter-menu.filtered_by_device", - "device_name", - computeDeviceName( - (ev.currentTarget as any).comboBox.selectedItem, - this.hass - ) + { + device_name: computeDeviceName( + (ev.currentTarget as any).comboBox.selectedItem, + this.hass + ), + } ); const items = await findRelated(this.hass, "device", deviceId); @@ -170,8 +174,7 @@ export class HaRelatedFilterButtonMenu extends LitElement { } const filter = this.hass.localize( "ui.components.related-filter-menu.filtered_by_area", - "area_name", - (ev.currentTarget as any).comboBox.selectedItem.name + { area_name: (ev.currentTarget as any).comboBox.selectedItem.name } ); const items = await findRelated(this.hass, "area", areaId); fireEvent(this, "related-changed", { diff --git a/src/components/media-player/ha-media-player-browse.ts b/src/components/media-player/ha-media-player-browse.ts index e5c895e74268..cc755e688771 100644 --- a/src/components/media-player/ha-media-player-browse.ts +++ b/src/components/media-player/ha-media-player-browse.ts @@ -798,10 +798,8 @@ export class HaMediaPlayerBrowse extends LitElement {

${this.hass.localize("ui.components.media-browser.no_media_folder")}
- ${this.hass.localize( - "ui.components.media-browser.setup_local_help", - "documentation", - html`${this.hass.localize( "ui.components.media-browser.documentation" )}` - )} + >`, + })}
${this.hass.localize("ui.components.media-browser.local_media_files")}

diff --git a/src/data/application_credential.ts b/src/data/application_credential.ts index 65f9d25a7da7..4b4cebdac98b 100644 --- a/src/data/application_credential.ts +++ b/src/data/application_credential.ts @@ -1,7 +1,7 @@ import { HomeAssistant } from "../types"; export interface ApplicationCredentialsDomainConfig { - description_placeholders: string; + description_placeholders: Record; } export interface ApplicationCredentialsConfig { diff --git a/src/data/device_automation.ts b/src/data/device_automation.ts index 5dc8e2879204..b32355e833ed 100644 --- a/src/data/device_automation.ts +++ b/src/data/device_automation.ts @@ -201,14 +201,14 @@ export const localizeDeviceAutomationAction = ( ): string => hass.localize( `component.${action.domain}.device_automation.action_type.${action.type}`, - "entity_name", - getEntityName(hass, entityRegistry, action.entity_id), - "subtype", - action.subtype - ? hass.localize( - `component.${action.domain}.device_automation.action_subtype.${action.subtype}` - ) || action.subtype - : "" + { + entity_name: getEntityName(hass, entityRegistry, action.entity_id), + subtype: action.subtype + ? hass.localize( + `component.${action.domain}.device_automation.action_subtype.${action.subtype}` + ) || action.subtype + : "", + } ) || (action.subtype ? `"${action.subtype}" ${action.type}` : action.type!); export const localizeDeviceAutomationCondition = ( @@ -218,14 +218,14 @@ export const localizeDeviceAutomationCondition = ( ): string => hass.localize( `component.${condition.domain}.device_automation.condition_type.${condition.type}`, - "entity_name", - getEntityName(hass, entityRegistry, condition.entity_id), - "subtype", - condition.subtype - ? hass.localize( - `component.${condition.domain}.device_automation.condition_subtype.${condition.subtype}` - ) || condition.subtype - : "" + { + entity_name: getEntityName(hass, entityRegistry, condition.entity_id), + subtype: condition.subtype + ? hass.localize( + `component.${condition.domain}.device_automation.condition_subtype.${condition.subtype}` + ) || condition.subtype + : "", + } ) || (condition.subtype ? `"${condition.subtype}" ${condition.type}` @@ -238,14 +238,14 @@ export const localizeDeviceAutomationTrigger = ( ): string => hass.localize( `component.${trigger.domain}.device_automation.trigger_type.${trigger.type}`, - "entity_name", - getEntityName(hass, entityRegistry, trigger.entity_id), - "subtype", - trigger.subtype - ? hass.localize( - `component.${trigger.domain}.device_automation.trigger_subtype.${trigger.subtype}` - ) || trigger.subtype - : "" + { + entity_name: getEntityName(hass, entityRegistry, trigger.entity_id), + subtype: trigger.subtype + ? hass.localize( + `component.${trigger.domain}.device_automation.trigger_subtype.${trigger.subtype}` + ) || trigger.subtype + : "", + } ) || (trigger.subtype ? `"${trigger.subtype}" ${trigger.type}` : trigger.type!); diff --git a/src/data/device_registry.ts b/src/data/device_registry.ts index 37685de00792..0919b4c1acb1 100644 --- a/src/data/device_registry.ts +++ b/src/data/device_registry.ts @@ -64,13 +64,11 @@ export const computeDeviceName = ( device.name_by_user || device.name || (entities && fallbackDeviceName(hass, entities)) || - hass.localize( - "ui.panel.config.devices.unnamed_device", - "type", - hass.localize( + hass.localize("ui.panel.config.devices.unnamed_device", { + type: hass.localize( `ui.panel.config.devices.type.${device.entry_type || "device"}` - ) - ); + ), + }); export const devicesInArea = (devices: DeviceRegistryEntry[], areaId: string) => devices.filter((device) => device.area_id === areaId); diff --git a/src/data/logbook.ts b/src/data/logbook.ts index 8534d548ceb8..703ca6969dd9 100644 --- a/src/data/logbook.ts +++ b/src/data/logbook.ts @@ -194,7 +194,7 @@ export const localizeStateMessage = ( if (state === "home") { return localize(`${LOGBOOK_LOCALIZE_PATH}.was_at_home`); } - return localize(`${LOGBOOK_LOCALIZE_PATH}.was_at_state`, "state", state); + return localize(`${LOGBOOK_LOCALIZE_PATH}.was_at_state`, { state }); case "sun": return state === "above_horizon" @@ -382,11 +382,9 @@ export const localizeStateMessage = ( return localize(`${LOGBOOK_LOCALIZE_PATH}.became_unavailable`); } - return hass.localize( - `${LOGBOOK_LOCALIZE_PATH}.changed_to_state`, - "state", - stateObj ? hass.formatEntityState(stateObj, state) : state - ); + return hass.localize(`${LOGBOOK_LOCALIZE_PATH}.changed_to_state`, { + state: stateObj ? hass.formatEntityState(stateObj, state) : state, + }); }; export const filterLogbookCompatibleEntities: HaEntityPickerEntityFilterFunc = ( diff --git a/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts b/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts index afd1c6f159c2..7ed96ec06197 100644 --- a/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts +++ b/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts @@ -56,9 +56,12 @@ class DialogConfigEntrySystemOptions extends LitElement { @closed=${this.closeDialog} .heading=${this.hass.localize( "ui.dialogs.config_entry_system_options.title", - "integration", - this.hass.localize(`component.${this._params.entry.domain}.title`) || - this._params.entry.domain + { + integration: + this.hass.localize( + `component.${this._params.entry.domain}.title` + ) || this._params.entry.domain, + } )} > ${this._error ? html`
${this._error}
` : ""} @@ -71,10 +74,12 @@ class DialogConfigEntrySystemOptions extends LitElement {

${this.hass.localize( "ui.dialogs.config_entry_system_options.enable_new_entities_description", - "integration", - this.hass.localize( - `component.${this._params.entry.domain}.title` - ) || this._params.entry.domain + { + integration: + this.hass.localize( + `component.${this._params.entry.domain}.title` + ) || this._params.entry.domain, + } )}

`} .dir=${computeRTLDirection(this.hass)} @@ -96,10 +101,12 @@ class DialogConfigEntrySystemOptions extends LitElement {

${this.hass.localize( "ui.dialogs.config_entry_system_options.enable_polling_description", - "integration", - this.hass.localize( - `component.${this._params.entry.domain}.title` - ) || this._params.entry.domain + { + integration: + this.hass.localize( + `component.${this._params.entry.domain}.title` + ) || this._params.entry.domain, + } )}

`} .dir=${computeRTLDirection(this.hass)} diff --git a/src/dialogs/config-flow/show-dialog-config-flow.ts b/src/dialogs/config-flow/show-dialog-config-flow.ts index 23c37f1797b2..9ccc58184015 100644 --- a/src/dialogs/config-flow/show-dialog-config-flow.ts +++ b/src/dialogs/config-flow/show-dialog-config-flow.ts @@ -174,8 +174,7 @@ export const showConfigFlowDialog = (

${hass.localize( "ui.panel.config.integrations.config_flow.created_config", - "name", - step.title + { name: step.title } )}

`; diff --git a/src/dialogs/config-flow/step-flow-create-entry.ts b/src/dialogs/config-flow/step-flow-create-entry.ts index 1ceb034b7a0a..f7e15836d76b 100644 --- a/src/dialogs/config-flow/step-flow-create-entry.ts +++ b/src/dialogs/config-flow/step-flow-create-entry.ts @@ -98,8 +98,7 @@ class StepFlowCreateEntry extends LitElement { showAlertDialog(this, { text: this.hass.localize( "ui.panel.config.integrations.config_flow.error_saving_area", - "error", - err.message + { error: err.message } ), }); picker.value = null; diff --git a/src/dialogs/notifications/configurator-notification-item.ts b/src/dialogs/notifications/configurator-notification-item.ts index 306b0f40beed..ae69269952d1 100644 --- a/src/dialogs/notifications/configurator-notification-item.ts +++ b/src/dialogs/notifications/configurator-notification-item.ts @@ -25,11 +25,9 @@ export class HuiConfiguratorNotificationItem extends LitElement {
- ${this.hass.localize( - "ui.notification_drawer.click_to_configure", - "entity", - this.notification.attributes.friendly_name - )} + ${this.hass.localize("ui.notification_drawer.click_to_configure", { + entity: this.notification.attributes.friendly_name, + })}
diff --git a/src/dialogs/quick-bar/ha-quick-bar.ts b/src/dialogs/quick-bar/ha-quick-bar.ts index 5db6f06289e6..4daf94a0f88e 100644 --- a/src/dialogs/quick-bar/ha-quick-bar.ts +++ b/src/dialogs/quick-bar/ha-quick-bar.ts @@ -525,11 +525,9 @@ export class QuickBar extends LitElement { const commands = reloadableDomains.map((domain) => ({ primaryText: this.hass.localize(`ui.dialogs.quick-bar.commands.reload.${domain}`) || - this.hass.localize( - "ui.dialogs.quick-bar.commands.reload.reload", - "domain", - domainToName(localize, domain) - ), + this.hass.localize("ui.dialogs.quick-bar.commands.reload.reload", { + domain: domainToName(localize, domain), + }), action: () => this.hass.callService(domain, "reload"), iconPath: mdiReload, categoryText: this.hass.localize( @@ -590,10 +588,11 @@ export class QuickBar extends LitElement { const item = { primaryText: this.hass.localize( "ui.dialogs.quick-bar.commands.server_control.perform_action", - "action", - this.hass.localize( - `ui.dialogs.quick-bar.commands.server_control.${action}` - ) + { + action: this.hass.localize( + `ui.dialogs.quick-bar.commands.server_control.${action}` + ), + } ), iconPath: mdiServerNetwork, categoryText: this.hass.localize( diff --git a/src/layouts/hass-tabs-subpage-data-table.ts b/src/layouts/hass-tabs-subpage-data-table.ts index 5efadf11017b..f891f6b1f9b3 100644 --- a/src/layouts/hass-tabs-subpage-data-table.ts +++ b/src/layouts/hass-tabs-subpage-data-table.ts @@ -147,11 +147,9 @@ export class HaTabsSubpageDataTable extends LitElement { protected render(): TemplateResult { const hiddenLabel = this.numHidden ? this.hiddenLabel || - this.hass.localize( - "ui.components.data-table.hidden", - "number", - this.numHidden - ) || + this.hass.localize("ui.components.data-table.hidden", { + number: this.numHidden, + }) || this.numHidden : undefined; diff --git a/src/panels/config/application_credentials/ha-config-application-credentials.ts b/src/panels/config/application_credentials/ha-config-application-credentials.ts index ec1b97dba308..43a4a4b525e3 100644 --- a/src/panels/config/application_credentials/ha-config-application-credentials.ts +++ b/src/panels/config/application_credentials/ha-config-application-credentials.ts @@ -120,8 +120,7 @@ export class HaConfigApplicationCredentials extends LitElement {

${this.hass.localize( "ui.panel.config.application_credentials.picker.selected", - "number", - this._selected.length + { number: this._selected.length } )}

@@ -178,8 +177,7 @@ export class HaConfigApplicationCredentials extends LitElement { showConfirmationDialog(this, { title: this.hass.localize( `ui.panel.config.application_credentials.picker.remove_selected.confirm_title`, - "number", - this._selected.length + { number: this._selected.length } ), text: this.hass.localize( "ui.panel.config.application_credentials.picker.remove_selected.confirm_text" diff --git a/src/panels/config/areas/ha-config-areas-dashboard.ts b/src/panels/config/areas/ha-config-areas-dashboard.ts index 5b03220dec3a..3623d585571b 100644 --- a/src/panels/config/areas/ha-config-areas-dashboard.ts +++ b/src/panels/config/areas/ha-config-areas-dashboard.ts @@ -1,9 +1,10 @@ import { mdiHelpCircle, mdiPlus } from "@mdi/js"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { CSSResultGroup, LitElement, TemplateResult, css, html } from "lit"; import { customElement, property, state } from "lit/decorators"; import { styleMap } from "lit/directives/style-map"; import memoizeOne from "memoize-one"; +import { formatListWithAnds } from "../../../common/string/format-list"; import "../../../components/ha-fab"; import "../../../components/ha-icon-button"; import "../../../components/ha-svg-icon"; @@ -135,36 +136,26 @@ export class HaConfigAreasDashboard extends SubscribeMixin(LitElement) {

${area.name}

- ${area.devices - ? html` - ${this.hass.localize( + ${formatListWithAnds( + this.hass.locale, + [ + area.devices && + this.hass.localize( "ui.panel.config.integrations.config_entry.devices", - "count", - area.devices - )}${area.services ? "," : ""} - ` - : ""} - ${area.services - ? html` - ${this.hass.localize( + { count: area.devices } + ), + area.services && + this.hass.localize( "ui.panel.config.integrations.config_entry.services", - "count", - area.services - )} - ` - : ""} - ${(area.devices || area.services) && area.entities - ? this.hass.localize("ui.common.and") - : ""} - ${area.entities - ? html` - ${this.hass.localize( + { count: area.services } + ), + area.entities && + this.hass.localize( "ui.panel.config.integrations.config_entry.entities", - "count", - area.entities - )} - ` - : ""} + { count: area.entities } + ), + ].filter((v): v is string => Boolean(v)) + )}
1) { str += this.hass.localize( "ui.panel.config.automation.editor.actions.type.choose.option_description_additional", - "numberOfAdditionalConditions", - option.conditions.length - 1 + { numberOfAdditionalConditions: option.conditions.length - 1 } ); } return str; @@ -121,8 +120,7 @@ export class HaChooseAction extends LitElement implements ActionElement {

${this.hass.localize( "ui.panel.config.automation.editor.actions.type.choose.option", - "number", - idx + 1 + { number: idx + 1 } )}: ${this._getDescription(option, idx)}

diff --git a/src/panels/config/automation/condition/ha-automation-condition-editor.ts b/src/panels/config/automation/condition/ha-automation-condition-editor.ts index eb4558569e9a..f60132ae5915 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-editor.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-editor.ts @@ -49,8 +49,7 @@ export default class HaAutomationConditionEditor extends LitElement { ? html` ${this.hass.localize( "ui.panel.config.automation.editor.conditions.unsupported_condition", - "condition", - condition.condition + { condition: condition.condition } )} ` : ""} diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index 50302c280159..f3b8b0690063 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -543,8 +543,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { ) : this.hass.localize( "ui.panel.config.automation.editor.load_error_unknown", - "err_no", - err.status_code + { err_no: err.status_code } ), }); history.back(); diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index c608b2008655..eba138fc231e 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -352,10 +352,12 @@ class HaAutomationPicker extends LitElement { this._activeFilters = [ this.hass.localize( "ui.panel.config.automation.picker.filtered_by_blueprint", - "name", - !blueprintMeta || "error" in blueprintMeta - ? blueprint - : blueprintMeta.metadata.name || blueprint + { + name: + !blueprintMeta || "error" in blueprintMeta + ? blueprint + : blueprintMeta.metadata.name || blueprint, + } ), ]; } @@ -431,8 +433,7 @@ class HaAutomationPicker extends LitElement { ) : this.hass.localize( "ui.panel.config.automation.editor.load_error_unknown", - "err_no", - err.status_code + { err_no: err.status_code } ), }); } @@ -457,8 +458,7 @@ class HaAutomationPicker extends LitElement { await showAlertDialog(this, { text: this.hass.localize( "ui.panel.config.automation.editor.load_error_unknown", - "err_no", - err.status_code + { err_no: err.status_code } ), }); } diff --git a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts index cbc1e7bff34f..90ec31331ace 100644 --- a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts +++ b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts @@ -324,8 +324,7 @@ export default class HaAutomationTriggerRow extends LitElement { ? html` ${this.hass.localize( "ui.panel.config.automation.editor.triggers.unsupported_platform", - "platform", - this.trigger.platform + { platform: this.trigger.platform } )} ` : ""} diff --git a/src/panels/config/blueprint/dialog-import-blueprint.ts b/src/panels/config/blueprint/dialog-import-blueprint.ts index 779427086660..0e871fc19ad7 100644 --- a/src/panels/config/blueprint/dialog-import-blueprint.ts +++ b/src/panels/config/blueprint/dialog-import-blueprint.ts @@ -67,10 +67,10 @@ class DialogImportBlueprint extends LitElement { ${this._result ? html`${this.hass.localize( "ui.panel.config.blueprint.add.import_header", - "name", - html`${this._result.blueprint.metadata.name}`, - "domain", - this._result.blueprint.metadata.domain + { + name: html`${this._result.blueprint.metadata.name}`, + domain: this._result.blueprint.metadata.domain, + } )}
- ${this.hass.localize( - "ui.panel.config.cloud.account.tts.info", - "service", - '"tts.cloud_say"' - )} + ${this.hass.localize("ui.panel.config.cloud.account.tts.info", { + service: '"tts.cloud_say"', + })}

diff --git a/src/panels/config/core/ha-config-system-navigation.ts b/src/panels/config/core/ha-config-system-navigation.ts index ade0cf81a84a..821d3479b106 100644 --- a/src/panels/config/core/ha-config-system-navigation.ts +++ b/src/panels/config/core/ha-config-system-navigation.ts @@ -50,57 +50,39 @@ class HaConfigSystemNavigation extends LitElement { const pages = configSections.general .filter((page) => canShowPage(this.hass, page)) .map((page) => { - let description = ""; - - switch (page.translationKey) { - case "backup": - description = this._latestBackupDate - ? this.hass.localize( - "ui.panel.config.backup.description", - "relative_time", - relativeTime( + const description = + page.translationKey === "backup" + ? this._latestBackupDate + ? this.hass.localize("ui.panel.config.backup.description", { + relative_time: relativeTime( new Date(this._latestBackupDate), this.hass.locale - ) - ) + ), + }) : this.hass.localize( "ui.panel.config.backup.description_no_backup" - ); - break; - case "network": - description = this.hass.localize( - "ui.panel.config.network.description", - "state", - this._externalAccess - ? this.hass.localize("ui.panel.config.network.enabled") - : this.hass.localize("ui.panel.config.network.disabled") - ); - break; - case "storage": - description = this._storageInfo - ? this.hass.localize( - "ui.panel.config.storage.description", - "percent_used", - `${Math.round( + ) + : page.translationKey === "network" + ? this.hass.localize("ui.panel.config.network.description", { + state: this._externalAccess + ? this.hass.localize("ui.panel.config.network.enabled") + : this.hass.localize("ui.panel.config.network.disabled"), + }) + : page.translationKey === "storage" + ? this._storageInfo + ? this.hass.localize("ui.panel.config.storage.description", { + percent_used: `${Math.round( (this._storageInfo.used / this._storageInfo.total) * 100 )}${blankBeforePercent(this.hass.locale)}%`, - "free_space", - `${this._storageInfo.free} GB` - ) - : ""; - break; - case "hardware": - description = - this._boardName || - this.hass.localize("ui.panel.config.hardware.description"); - break; - - default: - description = this.hass.localize( - `ui.panel.config.${page.translationKey}.description` - ); - break; - } + free_space: `${this._storageInfo.free} GB`, + }) + : "" + : page.translationKey === "hardware" + ? this._boardName || + this.hass.localize("ui.panel.config.hardware.description") + : this.hass.localize( + `ui.panel.config.${page.translationKey}.description` + ); return { ...page, diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index bbe63dcbbb95..241043049c90 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -55,46 +55,40 @@ const randomTip = (hass: HomeAssistant, narrow: boolean) => { const weighted: string[] = []; let tips = [ { - content: hass.localize( - "ui.panel.config.tips.join", - "forums", - html`Forums`, - "twitter", - html`Twitter`, - "discord", - html`Chat`, - "blog", - html`Blog`, - "newsletter", - html`Newsletter - ` - ), + `, + }), weight: 2, narrow: true, }, diff --git a/src/panels/config/devices/device-detail/ha-device-entities-card.ts b/src/panels/config/devices/device-detail/ha-device-entities-card.ts index 4c1681d88500..4876f8c4f06e 100644 --- a/src/panels/config/devices/device-detail/ha-device-entities-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-entities-card.ts @@ -103,8 +103,7 @@ export class HaDeviceEntitiesCard extends LitElement { ` diff --git a/src/panels/config/devices/device-detail/ha-device-info-card.ts b/src/panels/config/devices/device-detail/ha-device-info-card.ts index 219031a40389..9443fbc56330 100644 --- a/src/panels/config/devices/device-detail/ha-device-info-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-info-card.ts @@ -26,15 +26,13 @@ export class HaDeviceCard extends LitElement { return html`
${this.device.model @@ -45,8 +43,7 @@ export class HaDeviceCard extends LitElement {
${this.hass.localize( "ui.panel.config.integrations.config_entry.manuf", - "manufacturer", - this.device.manufacturer + { manufacturer: this.device.manufacturer } )}
` @@ -79,8 +76,7 @@ export class HaDeviceCard extends LitElement { ? "version" : "firmware" }`, - "version", - this.device.sw_version + { version: this.device.sw_version } )}
` @@ -90,8 +86,7 @@ export class HaDeviceCard extends LitElement {
${this.hass.localize( "ui.panel.config.integrations.config_entry.hardware", - "version", - this.device.hw_version + { version: this.device.hw_version } )}
` diff --git a/src/panels/config/devices/device-detail/ha-device-via-devices-card.ts b/src/panels/config/devices/device-detail/ha-device-via-devices-card.ts index fd75189514bb..aa664ce9e0d0 100644 --- a/src/panels/config/devices/device-detail/ha-device-via-devices-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-via-devices-card.ts @@ -69,8 +69,7 @@ export class HaDeviceViaDevicesCard extends LitElement { ` diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts index d3d15a4a28f5..d3e5b38236a0 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts @@ -59,8 +59,7 @@ class DialogMQTTDeviceDebugInfo extends LitElement { @closed=${this._close} .heading=${this.hass!.localize( "ui.dialogs.mqtt_device_debug_info.title", - "device", - computeDeviceName(this._params.device, this.hass) + { device: computeDeviceName(this._params.device, this.hass) } )} >

@@ -179,11 +178,9 @@ class DialogMQTTDeviceDebugInfo extends LitElement { .subscribedTopic=${topic.topic} .summary=${this.hass!.localize( "ui.dialogs.mqtt_device_debug_info.recent_messages", - "n", - topic.messages.length + { n: topic.messages.length } )} - > - + > ` )} @@ -203,11 +200,9 @@ class DialogMQTTDeviceDebugInfo extends LitElement { .subscribedTopic=${topic.topic} .summary=${this.hass!.localize( "ui.dialogs.mqtt_device_debug_info.recent_tx_messages", - "n", - topic.messages.length + { n: topic.messages.length } )} - > - + > ` )} diff --git a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts index 64d9d0145b42..22d371bcc0f4 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts @@ -127,8 +127,7 @@ export class HaDeviceInfoZWaveJS extends SubscribeMixin(LitElement) { ${this._node.zwave_plus_version ? this.hass.localize( "ui.panel.config.zwave_js.device_info.zwave_plus_version", - "version", - this._node.zwave_plus_version + { version: this._node.zwave_plus_version } ) : this.hass.localize("ui.common.no")}

diff --git a/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts b/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts index 204d115b2461..13b5c0ab98d1 100644 --- a/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts +++ b/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts @@ -90,28 +90,29 @@ class DialogDeviceRegistryDetail extends LitElement {
${this.hass.localize( "ui.dialogs.device-registry-detail.enabled_label", - "type", - this.hass.localize( - `ui.dialogs.device-registry-detail.type.${ - device.entry_type || "device" - }` - ) + { + type: this.hass.localize( + `ui.dialogs.device-registry-detail.type.${ + device.entry_type || "device" + }` + ), + } )}
${this._disabledBy && this._disabledBy !== "user" ? this.hass.localize( "ui.dialogs.device-registry-detail.enabled_cause", - "type", - this.hass.localize( - `ui.dialogs.device-registry-detail.type.${ - device.entry_type || "device" - }` - ), - "cause", - this.hass.localize( - `config_entry.disabled_by.${this._disabledBy}` - ) + { + type: this.hass.localize( + `ui.dialogs.device-registry-detail.type.${ + device.entry_type || "device" + }` + ), + cause: this.hass.localize( + `config_entry.disabled_by.${this._disabledBy}` + ), + } ) : ""} ${this.hass.localize( diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts index c231c7310df5..ef55e03e9a7f 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -386,17 +386,14 @@ export class HaConfigDevicePage extends LitElement { if (device.disabled_by) { deviceInfo.push(html` - ${this.hass.localize( - "ui.panel.config.devices.enabled_cause", - "type", - this.hass.localize( + ${this.hass.localize("ui.panel.config.devices.enabled_cause", { + type: this.hass.localize( `ui.panel.config.devices.type.${device.entry_type || "device"}` ), - "cause", - this.hass.localize( + cause: this.hass.localize( `ui.panel.config.devices.disabled_by.${device.disabled_by}` - ) - )} + ), + })} ${device.disabled_by === "user" ? html` @@ -425,12 +422,13 @@ export class HaConfigDevicePage extends LitElement { .label=${device.disabled_by ? this.hass.localize( "ui.panel.config.devices.automation.create_disable", - "type", - this.hass.localize( - `ui.panel.config.devices.type.${ - device.entry_type || "device" - }` - ) + { + type: this.hass.localize( + `ui.panel.config.devices.type.${ + device.entry_type || "device" + }` + ), + } ) : this.hass.localize( "ui.panel.config.devices.automation.create", @@ -485,19 +483,16 @@ export class HaConfigDevicePage extends LitElement { ` : html`
- ${this.hass.localize( - "ui.panel.config.devices.add_prompt", - "name", - this.hass.localize( + ${this.hass.localize("ui.panel.config.devices.add_prompt", { + name: this.hass.localize( "ui.panel.config.devices.automation.automations" ), - "type", - this.hass.localize( + type: this.hass.localize( `ui.panel.config.devices.type.${ device.entry_type || "device" }` - ) - )} + ), + })}
`} @@ -516,25 +511,18 @@ export class HaConfigDevicePage extends LitElement { @@ -582,16 +570,16 @@ export class HaConfigDevicePage extends LitElement {
${this.hass.localize( "ui.panel.config.devices.add_prompt", - "name", - this.hass.localize( - "ui.panel.config.devices.scene.scenes" - ), - "type", - this.hass.localize( - `ui.panel.config.devices.type.${ - device.entry_type || "device" - }` - ) + { + name: this.hass.localize( + "ui.panel.config.devices.scene.scenes" + ), + type: this.hass.localize( + `ui.panel.config.devices.type.${ + device.entry_type || "device" + }` + ), + } )}
`} @@ -609,25 +597,18 @@ export class HaConfigDevicePage extends LitElement { @@ -660,19 +641,16 @@ export class HaConfigDevicePage extends LitElement { ` : html`
- ${this.hass.localize( - "ui.panel.config.devices.add_prompt", - "name", - this.hass.localize( + ${this.hass.localize("ui.panel.config.devices.add_prompt", { + name: this.hass.localize( "ui.panel.config.devices.script.scripts" ), - "type", - this.hass.localize( + type: this.hass.localize( `ui.panel.config.devices.type.${ device.entry_type || "device" }` - ) - )} + ), + })}
`} @@ -685,15 +663,12 @@ export class HaConfigDevicePage extends LitElement { .narrow=${this.narrow} .header=${deviceName} > - - +
` @@ -1263,8 +1237,7 @@ export class HaConfigDevicePage extends LitElement { (await showConfirmationDialog(this, { title: this.hass.localize( "ui.panel.config.devices.confirm_disable_config_entry", - "entry_name", - config_entry.title + { entry_name: config_entry.title } ), confirmText: this.hass.localize("ui.common.yes"), dismissText: this.hass.localize("ui.common.no"), diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index 0526d048d11f..cce6b2e9675f 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -470,8 +470,7 @@ export class HaConfigDeviceDashboard extends LitElement { )} .hiddenLabel=${this.hass.localize( "ui.panel.config.devices.picker.filter.hidden_devices", - "number", - this._numHiddenDevices + { number: this._numHiddenDevices } )} .columns=${this._columns(this.narrow, this._showDisabled)} .data=${devicesOutput} diff --git a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts index dd42f8b34e55..422fde1665fd 100644 --- a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts +++ b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts @@ -82,8 +82,7 @@ export class EntityRegistrySettingsHelper extends LitElement { ${!this._componentLoaded ? this.hass.localize( "ui.dialogs.helper_settings.platform_not_loaded", - "platform", - this.entry.platform + { platform: this.entry.platform } ) : this._item === null ? this.hass.localize("ui.dialogs.helper_settings.yaml_not_editable") diff --git a/src/panels/config/entities/entity-registry-settings-editor.ts b/src/panels/config/entities/entity-registry-settings-editor.ts index 840e3101145c..ef94f8a33b1a 100644 --- a/src/panels/config/entities/entity-registry-settings-editor.ts +++ b/src/panels/config/entities/entity-registry-settings-editor.ts @@ -776,21 +776,23 @@ export class EntityRegistrySettingsEditor extends LitElement { ${this.hass.localize( "ui.dialogs.entity_registry.editor.configure_state", - "integration", - domainToName( - this.hass.localize, - this.helperConfigEntry.domain - ) + { + integration: domainToName( + this.hass.localize, + this.helperConfigEntry.domain + ), + } )} ${this.hass.localize( "ui.dialogs.entity_registry.editor.configure_state_secondary", - "integration", - domainToName( - this.hass.localize, - this.helperConfigEntry.domain - ) + { + integration: domainToName( + this.hass.localize, + this.helperConfigEntry.domain + ), + } )} @@ -828,10 +830,11 @@ export class EntityRegistrySettingsEditor extends LitElement { ? html`${this.hass.localize( "ui.dialogs.entity_registry.editor.enabled_cause", - "cause", - this.hass.localize( - `config_entry.disabled_by.${this._disabledBy!}` - ) + { + cause: this.hass.localize( + `config_entry.disabled_by.${this._disabledBy!}` + ), + } )}` : ""} @@ -862,8 +865,11 @@ export class EntityRegistrySettingsEditor extends LitElement { ? html`${this.hass.localize( "ui.dialogs.entity_registry.editor.hidden_cause", - "cause", - this.hass.localize(`config_entry.hidden_by.${this._hiddenBy!}`) + { + cause: this.hass.localize( + `config_entry.hidden_by.${this._hiddenBy!}` + ), + } )}` : ""} @@ -1036,8 +1042,7 @@ export class EntityRegistrySettingsEditor extends LitElement { showAlertDialog(this, { text: this.hass.localize( "ui.dialogs.entity_registry.editor.enabled_delay_confirm", - "delay", - result.reload_delay + { delay: result.reload_delay } ), }); } diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index f8ed35716754..816363e617fd 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -182,8 +182,7 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { showAlertDialog(this, { text: this.hass.localize( "ui.dialogs.entity_registry.editor.enabled_delay_confirm", - "delay", - result.reload_delay + { delay: result.reload_delay } ), }); } diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index 8a0dcc6f988a..b731e32d1ea9 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -539,8 +539,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { )} .hiddenLabel=${this.hass.localize( "ui.panel.config.entities.picker.filter.hidden_entities", - "number", - this._numHiddenEntities + { number: this._numHiddenEntities } )} .filter=${this._filter} selectable @@ -568,8 +567,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {

${this.hass.localize( "ui.panel.config.entities.picker.selected", - "number", - this._selectedEntities.length + { number: this._selectedEntities.length } )}

@@ -809,8 +807,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { showConfirmationDialog(this, { title: this.hass.localize( "ui.panel.config.entities.picker.enable_selected.confirm_title", - "number", - this._selectedEntities.length + { number: this._selectedEntities.length } ), text: this.hass.localize( "ui.panel.config.entities.picker.enable_selected.confirm_text" @@ -846,8 +843,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { showAlertDialog(this, { text: this.hass.localize( "ui.dialogs.entity_registry.editor.enabled_delay_confirm", - "delay", - reload_delay + { delay: reload_delay } ), }); } @@ -859,8 +855,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { showConfirmationDialog(this, { title: this.hass.localize( "ui.panel.config.entities.picker.disable_selected.confirm_title", - "number", - this._selectedEntities.length + { number: this._selectedEntities.length } ), text: this.hass.localize( "ui.panel.config.entities.picker.disable_selected.confirm_text" @@ -882,8 +877,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { showConfirmationDialog(this, { title: this.hass.localize( "ui.panel.config.entities.picker.hide_selected.confirm_title", - "number", - this._selectedEntities.length + { number: this._selectedEntities.length } ), text: this.hass.localize( "ui.panel.config.entities.picker.hide_selected.confirm_text" @@ -913,8 +907,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { ? "partly_" : "" }title`, - "number", - removeableEntities.length + { number: removeableEntities.length } ), text: removeableEntities.length === this._selectedEntities.length @@ -923,10 +916,10 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { ) : this.hass.localize( "ui.panel.config.entities.picker.remove_selected.confirm_partly_text", - "removable", - removeableEntities.length, - "selected", - this._selectedEntities.length + { + removable: removeableEntities.length, + selected: this._selectedEntities.length, + } ), confirmText: this.hass.localize("ui.common.remove"), dismissText: this.hass.localize("ui.common.cancel"), diff --git a/src/panels/config/helpers/dialog-helper-detail.ts b/src/panels/config/helpers/dialog-helper-detail.ts index 76efa6e17e06..3eee77eaa6bd 100644 --- a/src/panels/config/helpers/dialog-helper-detail.ts +++ b/src/panels/config/helpers/dialog-helper-detail.ts @@ -224,8 +224,7 @@ export class DialogHelperDetail extends LitElement { ${this.hass.localize( "ui.dialogs.helper_settings.platform_not_loaded", - "platform", - domain + { platform: domain } )} ` @@ -249,10 +248,12 @@ export class DialogHelperDetail extends LitElement { this._domain ? this.hass.localize( "ui.panel.config.helpers.dialog.create_platform", - "platform", - this.hass.localize( - `ui.panel.config.helpers.types.${this._domain}` - ) || this._domain + { + platform: + this.hass.localize( + `ui.panel.config.helpers.types.${this._domain}` + ) || this._domain, + } ) : this.hass.localize("ui.panel.config.helpers.dialog.create_helper") )} diff --git a/src/panels/config/info/ha-config-info.ts b/src/panels/config/info/ha-config-info.ts index b1f4fafb316f..28c3bcaea53e 100644 --- a/src/panels/config/info/ha-config-info.ts +++ b/src/panels/config/info/ha-config-info.ts @@ -132,10 +132,7 @@ class HaConfigInfo extends LitElement { ${this.hass.localize( "ui.panel.config.info.frontend_version", - "version", - JS_VERSION, - "type", - JS_TYPE + { version: JS_VERSION, type: JS_TYPE } )}
diff --git a/src/panels/config/integrations/ha-config-flow-card.ts b/src/panels/config/integrations/ha-config-flow-card.ts index 2af91dcb2a3b..ad7df5b414b8 100644 --- a/src/panels/config/integrations/ha-config-flow-card.ts +++ b/src/panels/config/integrations/ha-config-flow-card.ts @@ -135,8 +135,7 @@ export class HaConfigFlowCard extends LitElement { const confirmed = await showConfirmationDialog(this, { title: this.hass!.localize( "ui.panel.config.integrations.ignore.confirm_ignore_title", - "name", - localizeConfigFlowTitle(this.hass.localize, this.flow) + { name: localizeConfigFlowTitle(this.hass.localize, this.flow) } ), text: this.hass!.localize( "ui.panel.config.integrations.ignore.confirm_ignore" diff --git a/src/panels/config/integrations/ha-config-integration-page.ts b/src/panels/config/integrations/ha-config-integration-page.ts index ab9bab716620..55c7cfc09f0c 100644 --- a/src/panels/config/integrations/ha-config-integration-page.ts +++ b/src/panels/config/integrations/ha-config-integration-page.ts @@ -305,8 +305,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) { `ui.panel.config.integrations.config_entry.${ services ? "services" : "devices" }`, - "count", - devices.length + { count: devices.length } )} @@ -323,8 +322,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) { > ${this.hass.localize( `ui.panel.config.integrations.config_entry.entities`, - "count", - entities.length + { count: entities.length } )} @@ -605,8 +603,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) { html`${this.hass.localize( `ui.panel.config.integrations.config_entry.${localizeKey}`, - "count", - items.length + { count: items.length } )}` ); @@ -619,8 +616,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) { href=${`/config/entities?historyBack=1&config_entry=${item.entry_id}`} >${this.hass.localize( "ui.panel.config.integrations.config_entry.entities", - "count", - entities.length + { count: entities.length } )}` ); @@ -729,8 +725,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) { ${this.hass.localize( `ui.panel.config.integrations.config_entry.devices`, - "count", - devices.length + { count: devices.length } )} @@ -749,8 +744,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) { > ${this.hass.localize( `ui.panel.config.integrations.config_entry.services`, - "count", - services.length + { count: services.length } )} @@ -767,8 +761,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) { > ${this.hass.localize( `ui.panel.config.integrations.config_entry.entities`, - "count", - entities.length + { count: entities.length } )} diff --git a/src/panels/config/integrations/ha-ignored-config-entry-card.ts b/src/panels/config/integrations/ha-ignored-config-entry-card.ts index 775343f7a7e1..f00d481d3794 100644 --- a/src/panels/config/integrations/ha-ignored-config-entry-card.ts +++ b/src/panels/config/integrations/ha-ignored-config-entry-card.ts @@ -47,8 +47,7 @@ export class HaIgnoredConfigEntryCard extends LitElement { showConfirmationDialog(this, { title: this.hass!.localize( "ui.panel.config.integrations.ignore.confirm_delete_ignore_title", - "name", - this.hass.localize(`component.${this.entry.domain}.title`) + { name: this.hass.localize(`component.${this.entry.domain}.title`) } ), text: this.hass!.localize( "ui.panel.config.integrations.ignore.confirm_delete_ignore" diff --git a/src/panels/config/integrations/ha-integration-card.ts b/src/panels/config/integrations/ha-integration-card.ts index 2ee7532b7efa..1a434fc51c0c 100644 --- a/src/panels/config/integrations/ha-integration-card.ts +++ b/src/panels/config/integrations/ha-integration-card.ts @@ -140,8 +140,7 @@ export class HaIntegrationCard extends LitElement { `ui.panel.config.integrations.config_entry.${ services ? "services" : "devices" }`, - "count", - devices.length + { count: devices.length } )} ` @@ -152,8 +151,7 @@ export class HaIntegrationCard extends LitElement { ${this.hass.localize( `ui.panel.config.integrations.config_entry.entities`, - "count", - entities.length + { count: entities.length } )} ` @@ -161,8 +159,7 @@ export class HaIntegrationCard extends LitElement { ${this.hass.localize( `ui.panel.config.integrations.config_entry.entries`, - "count", - this.items.length + { count: this.items.length } )} `} diff --git a/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts b/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts index b1bf864377d7..a4501073b132 100644 --- a/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts +++ b/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts @@ -110,15 +110,15 @@ class MqttSubscribeCard extends LitElement { ${this._messages.map( (msg) => html`
- ${this.hass.localize( - "ui.panel.config.mqtt.message_received", - "id", - msg.id, - "topic", - msg.message.topic, - "time", - formatTime(msg.time, this.hass!.locale, this.hass!.config) - )} + ${this.hass.localize("ui.panel.config.mqtt.message_received", { + id: msg.id, + topic: msg.message.topic, + time: formatTime( + msg.time, + this.hass!.locale, + this.hass!.config + ), + })}
${msg.payload}
QoS: ${msg.message.qos} - Retain: diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts index 5d4f476491d3..9544fa6bc824 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts @@ -78,11 +78,9 @@ class ZHADeviceCard extends SubscribeMixin(LitElement) {
${this.device.model}
- ${this.hass.localize( - "ui.dialogs.zha_device_info.manuf", - "manufacturer", - this.device.manufacturer - )} + ${this.hass.localize("ui.dialogs.zha_device_info.manuf", { + manufacturer: this.device.manufacturer, + })}
@@ -191,8 +189,7 @@ class ZHADeviceCard extends SubscribeMixin(LitElement) { showAlertDialog(this, { text: this.hass.localize( "ui.panel.config.integrations.config_flow.error_saving_area", - "error", - err.message + { error: err.message } ), }); picker.value = null; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts index c4a8668ebd9c..a2b3cac37601 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts @@ -58,11 +58,9 @@ class ZHADevicePairingStatusCard extends LitElement { ? html`
${this.device.model}
- ${this.hass.localize( - "ui.dialogs.zha_device_info.manuf", - "manufacturer", - this.device.manufacturer - )} + ${this.hass.localize("ui.dialogs.zha_device_info.manuf", { + manufacturer: this.device.manufacturer, + })}
` : nothing} diff --git a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-failed-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-failed-node.ts index a7a0494e4751..6b22e7a12ead 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-failed-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-failed-node.ts @@ -138,8 +138,7 @@ class DialogZWaveJSRemoveFailedNode extends LitElement {

${this.hass.localize( "ui.panel.config.zwave_js.remove_failed_node.removal_finished", - "id", - this._node!.node_id + { id: this._node!.node_id } )}

diff --git a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts index 8db12606c420..461936dc44a4 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts @@ -125,8 +125,7 @@ class DialogZWaveJSRemoveNode extends LitElement {

${this.hass.localize( "ui.panel.config.zwave_js.remove_node.exclusion_finished", - "id", - this._node!.node_id + { id: this._node!.node_id } )}

diff --git a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts index 0117e068da0b..df90deec4144 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts @@ -160,16 +160,17 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) { ${this.hass.localize( "ui.panel.config.zwave_js.node_config.attribution", - "device_database", - html`${this.hass.localize( - "ui.panel.config.zwave_js.node_config.zwave_js_device_database" - )}` + { + device_database: html`${this.hass.localize( + "ui.panel.config.zwave_js.node_config.zwave_js_device_database" + )}`, + } )}

@@ -184,8 +185,7 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) {

${this.hass.localize( "ui.panel.config.zwave_js.node_config.endpoint", - "endpoint", - endpoint + { endpoint } )}

diff --git a/src/panels/config/logs/dialog-system-log-detail.ts b/src/panels/config/logs/dialog-system-log-detail.ts index 4856efdb980c..5e047d7b07b2 100644 --- a/src/panels/config/logs/dialog-system-log-detail.ts +++ b/src/panels/config/logs/dialog-system-log-detail.ts @@ -69,13 +69,11 @@ class DialogSystemLogDetail extends LitElement { // Custom components with our official docs should not link to our docs !this._manifest.documentation.includes("://www.home-assistant.io")); - const title = this.hass.localize( - "ui.panel.config.logs.details", - "level", - html`${this.hass.localize(`ui.panel.config.logs.level.${item.level}`)}` - ); + >`, + }); return html` diff --git a/src/panels/config/logs/error-log-card.ts b/src/panels/config/logs/error-log-card.ts index aa0493ddd2e5..3e688149cc9c 100644 --- a/src/panels/config/logs/error-log-card.ts +++ b/src/panels/config/logs/error-log-card.ts @@ -179,10 +179,8 @@ class ErrorLogCard extends LitElement { } catch (err: any) { this._error = this.hass.localize( "ui.panel.config.logs.failed_get_logs", - "provider", - this.provider, - "error", - extractApiErrorMessage(err) + {provider:this.provider, + error:extractApiErrorMessage(err)} ); return; } diff --git a/src/panels/config/logs/system-log-card.ts b/src/panels/config/logs/system-log-card.ts index e05da8a75dd5..dbaa91062486 100644 --- a/src/panels/config/logs/system-log-card.ts +++ b/src/panels/config/logs/system-log-card.ts @@ -46,17 +46,14 @@ export class SystemLogCard extends LitElement { } private _multipleMessages(item: LoggedError): string { - return this.hass.localize( - "ui.panel.config.logs.multiple_messages", - "time", - formatSystemLogTime( + return this.hass.localize("ui.panel.config.logs.multiple_messages", { + time: formatSystemLogTime( item.first_occurred, this.hass.locale, this.hass.config ), - "counter", - item.count - ); + counter: item.count, + }); } private _getFilteredItems = memoizeOne( @@ -112,8 +109,7 @@ export class SystemLogCard extends LitElement { ? html`
${this.hass.localize( "ui.panel.config.logs.no_issues_search", - "term", - this.filter + { term: this.filter } )}
` : filteredItems.map( diff --git a/src/panels/config/network/supervisor-network.ts b/src/panels/config/network/supervisor-network.ts index faaa0a21006f..db6d00a08642 100644 --- a/src/panels/config/network/supervisor-network.ts +++ b/src/panels/config/network/supervisor-network.ts @@ -116,8 +116,7 @@ export class HassioNetwork extends LitElement { ? html`

${this.hass.localize( "ui.panel.config.network.supervisor.connected_to", - "ssid", - this._interface?.wifi?.ssid + { ssid: this._interface?.wifi?.ssid } )}

` : ""} diff --git a/src/panels/config/person/dialog-person-detail.ts b/src/panels/config/person/dialog-person-detail.ts index 9273ea02f82a..92ee079d7d27 100644 --- a/src/panels/config/person/dialog-person-detail.ts +++ b/src/panels/config/person/dialog-person-detail.ts @@ -306,8 +306,7 @@ class DialogPersonDetail extends LitElement { !(await showConfirmationDialog(this, { text: this.hass!.localize( "ui.panel.config.person.detail.confirm_delete_user", - "name", - this._name + { name: this._name } ), confirmText: this.hass!.localize( "ui.panel.config.person.detail.delete" diff --git a/src/panels/config/scene/ha-scene-editor.ts b/src/panels/config/scene/ha-scene-editor.ts index 5c7aba3f3bf7..816b63100156 100644 --- a/src/panels/config/scene/ha-scene-editor.ts +++ b/src/panels/config/scene/ha-scene-editor.ts @@ -587,8 +587,7 @@ export class HaSceneEditor extends SubscribeMixin( ) : this.hass.localize( "ui.panel.config.scene.editor.load_error_unknown", - "err_no", - err.status_code + { err_no: err.status_code } ), }); history.back(); diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index 6d43660242b2..1ed7527f3ca5 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -465,8 +465,7 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { ) : this.hass.localize( "ui.panel.config.script.editor.load_error_unknown", - "err_no", - resp.status_code || resp.code + { err_no: resp.status_code || resp.code } ) ); history.back(); @@ -610,11 +609,9 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { ev.stopPropagation(); await triggerScript(this.hass, this.scriptId!); showToast(this, { - message: this.hass.localize( - "ui.notification_toast.triggered", - "name", - this._config!.alias - ), + message: this.hass.localize("ui.notification_toast.triggered", { + name: this._config!.alias, + }), }); } diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index 179acd6c21ae..59a05f6b9e8b 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -303,10 +303,12 @@ class HaScriptPicker extends LitElement { this._activeFilters = [ this.hass.localize( "ui.panel.config.script.picker.filtered_by_blueprint", - "name", - !blueprintMeta || "error" in blueprintMeta - ? blueprint - : blueprintMeta.metadata.name || blueprint + { + name: + !blueprintMeta || "error" in blueprintMeta + ? blueprint + : blueprintMeta.metadata.name || blueprint, + } ), ]; } @@ -353,11 +355,9 @@ class HaScriptPicker extends LitElement { } await triggerScript(this.hass, entry.unique_id); showToast(this, { - message: this.hass.localize( - "ui.notification_toast.triggered", - "name", - computeStateName(script) - ), + message: this.hass.localize("ui.notification_toast.triggered", { + name: computeStateName(script), + }), }); }; @@ -419,8 +419,7 @@ class HaScriptPicker extends LitElement { await showAlertDialog(this, { text: this.hass.localize( "ui.panel.config.script.editor.load_error_unknown", - "err_no", - err.status_code + { err_no: err.status_code } ), }); } @@ -459,8 +458,7 @@ class HaScriptPicker extends LitElement { ) : this.hass.localize( "ui.panel.config.script.editor.load_error_unknown", - "err_no", - err.status_code + { err_no: err.status_code } ), }); } diff --git a/src/panels/config/tags/dialog-tag-detail.ts b/src/panels/config/tags/dialog-tag-detail.ts index 0026fa466858..7f402f2d4a4d 100644 --- a/src/panels/config/tags/dialog-tag-detail.ts +++ b/src/panels/config/tags/dialog-tag-detail.ts @@ -118,18 +118,16 @@ class DialogTagDetail ? html`

- ${this.hass!.localize( - "ui.panel.config.tag.detail.usage", - "companion_link", - html`${this.hass!.localize( "ui.panel.config.tag.detail.companion_apps" )}` - )} + >`, + })}

${this._qrCode @@ -251,11 +249,9 @@ class DialogTagDetail ); this._qrCode = html`${this.hass.localize(`; } diff --git a/src/panels/config/tags/ha-config-tags.ts b/src/panels/config/tags/ha-config-tags.ts index 4ac788eba29c..5eb80452e232 100644 --- a/src/panels/config/tags/ha-config-tags.ts +++ b/src/panels/config/tags/ha-config-tags.ts @@ -207,11 +207,9 @@ export class HaConfigTags extends SubscribeMixin(LitElement) { private _handleAutomationClick = (ev: Event) => { const tag = (ev.currentTarget as any).tag; const data = { - alias: this.hass.localize( - "ui.panel.config.tag.automation_title", - "name", - tag.name || tag.id - ), + alias: this.hass.localize("ui.panel.config.tag.automation_title", { + name: tag.name || tag.id, + }), trigger: [{ platform: "tag", tag_id: tag.id } as TagTrigger], }; showAutomationEditor(data); @@ -225,18 +223,16 @@ export class HaConfigTags extends SubscribeMixin(LitElement) { title: this.hass.localize("ui.panel.config.tag.caption"), text: html`

- ${this.hass.localize( - "ui.panel.config.tag.detail.usage", - "companion_link", - html`${this.hass!.localize( "ui.panel.config.tag.detail.companion_apps" )}` - )} + >`, + })}

${this.hass.localize( "ui.panel.config.entities.picker.selected", - "number", - this._selectedEntities.length + { number: this._selectedEntities.length } )}

diff --git a/src/panels/custom/ha-panel-custom.ts b/src/panels/custom/ha-panel-custom.ts index 203983d64cc5..9d685a18932e 100644 --- a/src/panels/custom/ha-panel-custom.ts +++ b/src/panels/custom/ha-panel-custom.ts @@ -102,10 +102,7 @@ export class HaPanelCustom extends ReactiveElement { !confirm( `${this.hass.localize( "ui.panel.custom.external_panel.question_trust", - "name", - config.name, - "link", - tempA.href + { name: config.name, link: tempA.href } )} ${this.hass.localize( diff --git a/src/panels/developer-tools/event/event-subscribe-card.ts b/src/panels/developer-tools/event/event-subscribe-card.ts index d6fc03547485..628ddfd8ef87 100644 --- a/src/panels/developer-tools/event/event-subscribe-card.ts +++ b/src/panels/developer-tools/event/event-subscribe-card.ts @@ -74,8 +74,7 @@ class EventSubscribeCard extends LitElement {
${this.hass!.localize( "ui.panel.developer-tools.tabs.events.event_fired", - "name", - event.id + { name: event.id } )} ${formatTime( new Date(event.event.time_fired), diff --git a/src/panels/developer-tools/service/developer-tools-service.ts b/src/panels/developer-tools/service/developer-tools-service.ts index 8ffd198e784d..1d88b0777107 100644 --- a/src/panels/developer-tools/service/developer-tools-service.ts +++ b/src/panels/developer-tools/service/developer-tools-service.ts @@ -380,11 +380,9 @@ class HaPanelDevService extends LitElement { button.actionError(); showToast(this, { message: - this.hass.localize( - "ui.notification_toast.service_call_failed", - "service", - this._serviceData.service - ) + ` ${err.message}`, + this.hass.localize("ui.notification_toast.service_call_failed", { + service: this._serviceData.service, + }) + ` ${err.message}`, }); return; } diff --git a/src/panels/developer-tools/yaml_configuration/developer-yaml-config.ts b/src/panels/developer-tools/yaml_configuration/developer-yaml-config.ts index 9d1545b1a41e..48f12e85c7a0 100644 --- a/src/panels/developer-tools/yaml_configuration/developer-yaml-config.ts +++ b/src/panels/developer-tools/yaml_configuration/developer-yaml-config.ts @@ -159,8 +159,7 @@ export class DeveloperYamlConfig extends LitElement { ) || this.hass.localize( "ui.panel.developer-tools.tabs.yaml.section.reloading.reload", - "domain", - domainToName(this.hass.localize, domain) + { domain: domainToName(this.hass.localize, domain) } )}
diff --git a/src/panels/lovelace/cards/hui-gauge-card.ts b/src/panels/lovelace/cards/hui-gauge-card.ts index 8edb38253a90..020440806367 100644 --- a/src/panels/lovelace/cards/hui-gauge-card.ts +++ b/src/panels/lovelace/cards/hui-gauge-card.ts @@ -104,8 +104,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { ${this.hass.localize( "ui.panel.lovelace.warning.entity_unavailable", - "entity", - this._config.entity + { entity: this._config.entity } )} `; @@ -116,8 +115,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { ${this.hass.localize( "ui.panel.lovelace.warning.entity_non_numeric", - "entity", - this._config.entity + { entity: this._config.entity } )} `; diff --git a/src/panels/lovelace/cards/hui-logbook-card.ts b/src/panels/lovelace/cards/hui-logbook-card.ts index 590220eb4786..d73e246eb1c4 100644 --- a/src/panels/lovelace/cards/hui-logbook-card.ts +++ b/src/panels/lovelace/cards/hui-logbook-card.ts @@ -106,11 +106,9 @@ export class HuiLogbookCard extends LitElement implements LovelaceCard { if (!isComponentLoaded(this.hass, "logbook")) { return html` - ${this.hass.localize( - "ui.components.logbook.not_loaded", - "platform", - "logbook" - )} `; } diff --git a/src/panels/lovelace/cards/hui-weather-forecast-card.ts b/src/panels/lovelace/cards/hui-weather-forecast-card.ts index dec8eac04cbb..b87dbef2c7fc 100644 --- a/src/panels/lovelace/cards/hui-weather-forecast-card.ts +++ b/src/panels/lovelace/cards/hui-weather-forecast-card.ts @@ -212,11 +212,9 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard { if (stateObj.state === UNAVAILABLE) { return html` - ${this.hass.localize( - "ui.panel.lovelace.warning.entity_unavailable", - "entity", - `${computeStateName(stateObj)} (${this._config.entity})` - )} + ${this.hass.localize("ui.panel.lovelace.warning.entity_unavailable", { + entity: `${computeStateName(stateObj)} (${this._config.entity})`, + })} `; } diff --git a/src/panels/lovelace/common/compute-tooltip.ts b/src/panels/lovelace/common/compute-tooltip.ts index d6dc844a0740..50b5b0485f97 100644 --- a/src/panels/lovelace/common/compute-tooltip.ts +++ b/src/panels/lovelace/common/compute-tooltip.ts @@ -20,50 +20,33 @@ function computeActionTooltip( return ""; } - let tooltip = + return ( (isHold ? hass.localize("ui.panel.lovelace.cards.picture-elements.hold") - : hass.localize("ui.panel.lovelace.cards.picture-elements.tap")) + " "; - - switch (config.action) { - case "navigate": - tooltip += `${hass.localize( - "ui.panel.lovelace.cards.picture-elements.navigate_to", - "location", - config.navigation_path - )}`; - break; - case "url": - tooltip += `${hass.localize( - "ui.panel.lovelace.cards.picture-elements.url", - "url_path", - config.url_path - )}`; - break; - case "toggle": - tooltip += `${hass.localize( - "ui.panel.lovelace.cards.picture-elements.toggle", - "name", - state - )}`; - break; - case "call-service": - tooltip += `${hass.localize( - "ui.panel.lovelace.cards.picture-elements.call_service", - "name", - config.service - )}`; - break; - case "more-info": - tooltip += `${hass.localize( - "ui.panel.lovelace.cards.picture-elements.more_info", - "name", - state - )}`; - break; - } - - return tooltip; + : hass.localize("ui.panel.lovelace.cards.picture-elements.tap")) + + " " + + (config.action === "navigate" + ? hass.localize("ui.panel.lovelace.cards.picture-elements.navigate_to", { + location: config.navigation_path, + }) + : config.action === "url" + ? hass.localize("ui.panel.lovelace.cards.picture-elements.url", { + url_path: config.url_path, + }) + : config.action === "toggle" + ? hass.localize("ui.panel.lovelace.cards.picture-elements.toggle", { + name: state, + }) + : config.action === "call-service" + ? hass.localize("ui.panel.lovelace.cards.picture-elements.call_service", { + name: config.service, + }) + : config.action === "more-info" + ? hass.localize("ui.panel.lovelace.cards.picture-elements.more_info", { + name: state, + }) + : "") + ); } export const computeTooltip = (hass: HomeAssistant, config: Config): string => { diff --git a/src/panels/lovelace/common/generate-lovelace-config.ts b/src/panels/lovelace/common/generate-lovelace-config.ts index f8dfa99cc30e..3a54e7ab7fe7 100644 --- a/src/panels/lovelace/common/generate-lovelace-config.ts +++ b/src/panels/lovelace/common/generate-lovelace-config.ts @@ -537,13 +537,11 @@ export const generateDefaultViewConfig = ( title: device.name_by_user || device.name || - localize( - "ui.panel.config.devices.unnamed_device", - "type", - localize( + localize("ui.panel.config.devices.unnamed_device", { + type: localize( `ui.panel.config.devices.type.${device.entry_type || "device"}` - ) - ), + ), + }), } ) ); diff --git a/src/panels/lovelace/common/handle-action.ts b/src/panels/lovelace/common/handle-action.ts index bd849bd42836..9d3166233626 100644 --- a/src/panels/lovelace/common/handle-action.ts +++ b/src/panels/lovelace/common/handle-action.ts @@ -74,15 +74,14 @@ export const handleAction = async ( !(await showConfirmationDialog(node, { text: actionConfig.confirmation.text || - hass.localize( - "ui.panel.lovelace.cards.actions.action_confirmation", - "action", - serviceName || + hass.localize("ui.panel.lovelace.cards.actions.action_confirmation", { + action: + serviceName || hass.localize( `ui.panel.lovelace.editor.action-editor.actions.${actionConfig.action}` ) || - actionConfig.action - ), + actionConfig.action, + }), })) ) { return; diff --git a/src/panels/lovelace/components/hui-warning.ts b/src/panels/lovelace/components/hui-warning.ts index 20f59819c249..3a70741a47c4 100644 --- a/src/panels/lovelace/components/hui-warning.ts +++ b/src/panels/lovelace/components/hui-warning.ts @@ -9,11 +9,9 @@ export const createEntityNotFoundWarning = ( entityId: string ) => hass.config.state !== STATE_NOT_RUNNING - ? hass.localize( - "ui.panel.lovelace.warning.entity_not_found", - "entity", - entityId || "[empty]" - ) + ? hass.localize("ui.panel.lovelace.warning.entity_not_found", { + entity: entityId || "[empty]", + }) : hass.localize("ui.panel.lovelace.warning.starting"); @customElement("hui-warning") diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts index e7a2bbcb51f4..ace3d7138288 100644 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts @@ -69,8 +69,7 @@ export class HuiCreateDialogCard const title = this._viewConfig.title ? this.hass!.localize( "ui.panel.lovelace.editor.edit_card.pick_card_view_title", - "name", - `"${this._viewConfig.title}"` + { name: `"${this._viewConfig.title}"` } ) : this.hass!.localize("ui.panel.lovelace.editor.edit_card.pick_card"); diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts index f881cb6f57eb..b145b1c4f916 100644 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts @@ -149,17 +149,17 @@ export class HuiDialogEditCard if (this._cardConfig && this._cardConfig.type) { heading = this.hass!.localize( "ui.panel.lovelace.editor.edit_card.typed_header", - "type", - this.hass!.localize( - `ui.panel.lovelace.editor.card.${this._cardConfig.type}.name` - ) + { + type: this.hass!.localize( + `ui.panel.lovelace.editor.card.${this._cardConfig.type}.name` + ), + } ); } else if (!this._cardConfig) { heading = this._viewConfig.title ? this.hass!.localize( "ui.panel.lovelace.editor.edit_card.pick_card_view_title", - "name", - `"${this._viewConfig.title}"` + { name: `"${this._viewConfig.title}"` } ) : this.hass!.localize("ui.panel.lovelace.editor.edit_card.pick_card"); } else { diff --git a/src/panels/lovelace/editor/header-footer-editor/hui-dialog-create-headerfooter.ts b/src/panels/lovelace/editor/header-footer-editor/hui-dialog-create-headerfooter.ts index 092dd0213475..f3d25a213030 100644 --- a/src/panels/lovelace/editor/header-footer-editor/hui-dialog-create-headerfooter.ts +++ b/src/panels/lovelace/editor/header-footer-editor/hui-dialog-create-headerfooter.ts @@ -45,10 +45,11 @@ export class HuiCreateDialogHeaderFooter this.hass, this.hass!.localize( `ui.panel.lovelace.editor.header-footer.choose_header_footer`, - "type", - this.hass!.localize( - `ui.panel.lovelace.editor.header-footer.${this._params.type}` - ) + { + type: this.hass!.localize( + `ui.panel.lovelace.editor.header-footer.${this._params.type}` + ), + } ) )} @keydown=${this._ignoreKeydown} diff --git a/src/panels/lovelace/editor/hui-element-editor.ts b/src/panels/lovelace/editor/hui-element-editor.ts index 2d2b58f4a10f..2de39a3f95d9 100644 --- a/src/panels/lovelace/editor/hui-element-editor.ts +++ b/src/panels/lovelace/editor/hui-element-editor.ts @@ -234,11 +234,9 @@ export abstract class HuiElementEditor extends LitElement { ${this._guiSupported === false && this.configElementType ? html`
- ${this.hass.localize( - "ui.errors.config.editor_not_available", - "type", - this.configElementType - )} + ${this.hass.localize("ui.errors.config.editor_not_available", { + type: this.configElementType, + })}
` : ""} diff --git a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts index d873e8d5e129..027865fd7ca4 100644 --- a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts +++ b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts @@ -129,8 +129,7 @@ export class HuiDialogEditView extends LitElement { return this.hass!.localize( "ui.panel.lovelace.editor.edit_view.header_name", - "name", - this._config.title + { name: this._config.title } ); } @@ -367,10 +366,10 @@ export class HuiDialogEditView extends LitElement { `ui.panel.lovelace.views.confirm_delete${ this._cards?.length ? "_existing_cards" : "" }_text`, - "name", - this._config?.title || "Unnamed view", - "number", - this._cards?.length || 0 + { + name: this._config?.title || "Unnamed view", + number: this._cards?.length || 0, + } ), confirm: () => this._delete(), }); diff --git a/src/panels/lovelace/elements/hui-state-label-element.ts b/src/panels/lovelace/elements/hui-state-label-element.ts index a0427bdbcd22..e19f39f5c517 100644 --- a/src/panels/lovelace/elements/hui-state-label-element.ts +++ b/src/panels/lovelace/elements/hui-state-label-element.ts @@ -60,10 +60,7 @@ class HuiStateLabelElement extends LitElement implements LovelaceElement { `; diff --git a/src/panels/lovelace/entity-rows/hui-script-entity-row.ts b/src/panels/lovelace/entity-rows/hui-script-entity-row.ts index 5e97a255397c..050209570ac6 100644 --- a/src/panels/lovelace/entity-rows/hui-script-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-script-entity-row.ts @@ -53,12 +53,11 @@ class HuiScriptEntityRow extends LitElement implements LovelaceRow { ${stateObj.state === "on" ? html` ${stateObj.attributes.mode !== "single" && - (stateObj.attributes.current || 0) > 0 - ? this.hass.localize( - "ui.card.script.cancel_multiple", - "number", - stateObj.attributes.current - ) + stateObj.attributes.current && + stateObj.attributes.current > 0 + ? this.hass.localize("ui.card.script.cancel_multiple", { + number: stateObj.attributes.current, + }) : this.hass.localize("ui.card.script.cancel")} ` : ""} diff --git a/src/panels/lovelace/hui-editor.ts b/src/panels/lovelace/hui-editor.ts index 9bf7cb9cc511..1b1894e2b660 100644 --- a/src/panels/lovelace/hui-editor.ts +++ b/src/panels/lovelace/hui-editor.ts @@ -204,8 +204,7 @@ class LovelaceFullConfigEditor extends LitElement { showAlertDialog(this, { text: this.hass.localize( "ui.panel.lovelace.editor.raw_editor.error_remove", - "error", - err + { error: err } ), }); } @@ -254,8 +253,7 @@ class LovelaceFullConfigEditor extends LitElement { showAlertDialog(this, { text: this.hass.localize( "ui.panel.lovelace.editor.raw_editor.error_parse_yaml", - "error", - err + { error: err } ), }); this._saving = false; @@ -267,8 +265,7 @@ class LovelaceFullConfigEditor extends LitElement { showAlertDialog(this, { text: this.hass.localize( "ui.panel.lovelace.editor.raw_editor.error_invalid_config", - "error", - err + { error: err } ), }); return; @@ -287,8 +284,7 @@ class LovelaceFullConfigEditor extends LitElement { showAlertDialog(this, { text: this.hass.localize( "ui.panel.lovelace.editor.raw_editor.error_save_yaml", - "error", - err + { error: err } ), }); } diff --git a/src/panels/mailbox/ha-panel-mailbox.ts b/src/panels/mailbox/ha-panel-mailbox.ts index 04c155fde584..4dd210133caa 100644 --- a/src/panels/mailbox/ha-panel-mailbox.ts +++ b/src/panels/mailbox/ha-panel-mailbox.ts @@ -89,11 +89,9 @@ class HaPanelMailbox extends LitElement {
${message.caller}
- ${this.hass.localize( - "ui.duration.second", - "count", - message.duration - )} + ${this.hass.localize("ui.duration.second", { + count: message.duration, + })}
diff --git a/src/panels/my/ha-panel-my.ts b/src/panels/my/ha-panel-my.ts index 9810837ccfbf..a71054a63d14 100644 --- a/src/panels/my/ha-panel-my.ts +++ b/src/panels/my/ha-panel-my.ts @@ -375,74 +375,55 @@ class HaPanelMy extends LitElement { } protected render() { - if (this._error) { - let error: string; - switch (this._error) { - case "not_supported": - error = - this.hass.localize( - "ui.panel.my.not_supported", - "link", - html`${this.hass.localize("ui.panel.my.faq_link")}` - ) || "This redirect is not supported."; - break; - case "no_component": - error = - this.hass.localize( - "ui.panel.my.component_not_loaded", - "integration", - html`${domainToName( - this.hass.localize, - this._redirect!.component! - )}` - ) || "This redirect is not supported."; - break; - case "no_supervisor": - error = this.hass.localize( - "ui.panel.my.no_supervisor", - "docs_link", - html`${this.hass.localize("ui.panel.my.faq_link")}`, + }) || "This redirect is not supported." + : this._error === "no_component" + ? this.hass.localize("ui.panel.my.component_not_loaded", { + integration: html`${domainToName( + this.hass.localize, + this._redirect!.component! + )}`, + }) || "This redirect is not supported." + : this._error === "no_supervisor" + ? this.hass.localize("ui.panel.my.no_supervisor", { + docs_link: html`${this.hass.localize("ui.panel.my.documentation")}` - ); - break; - case "not_app": - error = this.hass.localize( - "ui.panel.my.not_app", - "link", - html``, + }) + : this._error === "not_app" + ? this.hass.localize("ui.panel.my.not_app", { + link: html`${this.hass.localize("ui.panel.my.download_app")}` - ); - break; - default: - error = this.hass.localize("ui.panel.my.error") || "Unknown error"; - } - return html``; - } - return nothing; + >`, + }) + : this.hass.localize("ui.panel.my.error") || "Unknown error"; + return html``; } private _createRedirectUrl(): string { diff --git a/src/panels/profile/dialog-ha-mfa-module-setup-flow.ts b/src/panels/profile/dialog-ha-mfa-module-setup-flow.ts index e5e9ff4abe78..94b0a6f4eb56 100644 --- a/src/panels/profile/dialog-ha-mfa-module-setup-flow.ts +++ b/src/panels/profile/dialog-ha-mfa-module-setup-flow.ts @@ -97,8 +97,7 @@ class HaMfaModuleSetupFlow extends LitElement { ? html`

${this.hass.localize( "ui.panel.profile.mfa_setup.step_done", - "step", - this._step.title + { step: this._step.title } )}

` : this._step.type === "form" diff --git a/src/panels/profile/ha-long-lived-access-token-dialog.ts b/src/panels/profile/ha-long-lived-access-token-dialog.ts index 7841e4918ae1..4dd9fe129881 100644 --- a/src/panels/profile/ha-long-lived-access-token-dialog.ts +++ b/src/panels/profile/ha-long-lived-access-token-dialog.ts @@ -115,8 +115,7 @@ export class HaLongLivedAccessTokenDialog extends LitElement { this._qrCode = html`${this.hass.localize(`; diff --git a/src/panels/profile/ha-long-lived-access-tokens-card.ts b/src/panels/profile/ha-long-lived-access-tokens-card.ts index c622ad0d7e85..a835f9898695 100644 --- a/src/panels/profile/ha-long-lived-access-tokens-card.ts +++ b/src/panels/profile/ha-long-lived-access-tokens-card.ts @@ -67,11 +67,12 @@ class HaLongLivedTokens extends LitElement {
${this.hass.localize( "ui.panel.profile.long_lived_access_tokens.created", - "date", - relativeTime( - new Date(token.created_at), - this.hass.locale - ) + { + date: relativeTime( + new Date(token.created_at), + this.hass.locale + ), + } )}
${stateObj.attributes.mode !== "single" && - (stateObj.attributes.current || 0) > 0 - ? this.hass.localize( - "ui.card.script.cancel_multiple", - "number", - stateObj.attributes.current - ) + stateObj.attributes.current && + stateObj.attributes.current > 0 + ? this.hass.localize("ui.card.script.cancel_multiple", { + number: stateObj.attributes.current, + }) : this.hass.localize("ui.card.script.cancel")} ` : ""} diff --git a/src/state/disconnect-toast-mixin.ts b/src/state/disconnect-toast-mixin.ts index c74773c91325..d45d873bdd74 100644 --- a/src/state/disconnect-toast-mixin.ts +++ b/src/state/disconnect-toast-mixin.ts @@ -121,11 +121,9 @@ export default >(superClass: T) => showToast(this, { message: - this.hass!.localize( - "ui.notification_toast.integration_starting", - "integration", - domainToName(this.hass!.localize, integration) - ) || + this.hass!.localize("ui.notification_toast.integration_starting", { + integration: domainToName(this.hass!.localize, integration), + }) || `Starting ${integration}, not everything will be available until it is finished.`, duration: 0, dismissable: false, diff --git a/src/translations/en.json b/src/translations/en.json index 33ac44cddbcf..fb040bbe455b 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2662,7 +2662,7 @@ "delete": "[%key:ui::common::delete%]", "delete_confirm_title": "Delete action?", "delete_confirm_text": "[%key:ui::panel::config::automation::editor::triggers::delete_confirm_text%]", - "unsupported_action": "No visual editor support for action: {action}", + "unsupported_action": "No visual editor support for this action", "type_select": "Action type", "continue_on_error": "Continue on error", "type": {