Skip to content

Commit

Permalink
Add localizable "Filtering by config entry" for Entities and Devices (#…
Browse files Browse the repository at this point in the history
…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 }
  • Loading branch information
NoRi2909 authored Jan 6, 2025
1 parent ff75c89 commit f043886
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/panels/config/devices/ha-config-devices-dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,9 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) {
${Array.isArray(this._filters.config_entry?.value) &&
this._filters.config_entry?.value.length
? html`<ha-alert slot="filter-pane">
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]
Expand Down
4 changes: 3 additions & 1 deletion src/panels/config/entities/ha-config-entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,9 @@ ${
Array.isArray(this._filters.config_entry) &&
this._filters.config_entry?.length
? html`<ha-alert slot="filter-pane">
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]}
Expand Down
2 changes: 2 additions & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit f043886

Please sign in to comment.