From f043886273d8e2633cf9884af796c49fc1591121 Mon Sep 17 00:00:00 2001 From: Norbert Rittel Date: Mon, 6 Jan 2025 08:54:07 +0100 Subject: [PATCH] Add localizable "Filtering by config entry" for Entities and Devices (#23544) * Add localizable "Filtering by config entry" to en.json This commit adds two strings for localizing "Filtering by config entry" to the Entities panel and, referenced from there, to the Devices panel. * Replace "Filtering by config entry" with localizable key * Replace "Filtering by config entry" with localizable key * Add missing comma * Add missing } * Add missing } --- src/panels/config/devices/ha-config-devices-dashboard.ts | 4 +++- src/panels/config/entities/ha-config-entities.ts | 4 +++- src/translations/en.json | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index 71e2a5e61033..c0ba1f330ebf 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -749,7 +749,9 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { ${Array.isArray(this._filters.config_entry?.value) && this._filters.config_entry?.value.length ? html` - Filtering by config entry + ${this.hass.localize( + "ui.panel.config.devices.filtering_by_config_entry" + )} ${this.entries?.find( (entry) => entry.entry_id === this._filters.config_entry!.value![0] diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index 937dcfa30999..5cdcfa648809 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -904,7 +904,9 @@ ${ Array.isArray(this._filters.config_entry) && this._filters.config_entry?.length ? html` - Filtering by config entry + ${this.hass.localize( + "ui.panel.config.entities.picker.filtering_by_config_entry" + )} ${this._entries?.find( (entry) => entry.entry_id === this._filters.config_entry![0] )?.title || this._filters.config_entry[0]} diff --git a/src/translations/en.json b/src/translations/en.json index b75f116a4d37..4522f7efa509 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -4245,6 +4245,7 @@ "add_device": "Add device", "caption": "Devices", "description": "Manage configured devices", + "filtering_by_config_entry": "[%key:ui::panel::config::entities::picker::filtering_by_config_entry%]", "device_info": "{type} info", "edit_settings": "Edit settings", "unnamed_device": "Unnamed {type}", @@ -4392,6 +4393,7 @@ "introduction2": "Use the entity registry to override the name, change the entity ID or remove the entry from Home Assistant.", "search": "Search {number} entities", "unnamed_entity": "Unnamed entity", + "filtering_by_config_entry": "Filtering by config entry", "status": { "available": "Available", "unavailable": "Unavailable",