Add support for icon translations (#19406)

* Add support for icon translations

* Use slot for icons

* Update more-info-climate.ts

* Review and fixes

* Update entity-registry-settings-editor.ts
This commit is contained in:
Bram Kragten
2024-01-19 14:55:02 +01:00
committed by GitHub
parent b969144f50
commit 081636b3e7
51 changed files with 479 additions and 87 deletions

View File

@@ -126,9 +126,9 @@ export class HaControlSelectMenu extends SelectBase {
return html`
<div class="icon">
${icon && "path" in icon
${icon && icon.localName === "ha-svg-icon" && "path" in icon
? html`<ha-svg-icon .path=${icon.path}></ha-svg-icon>`
: icon && "icon" in icon
: icon && icon.localName === "ha-icon" && "icon" in icon
? html`<ha-icon .path=${icon.icon}></ha-icon>`
: html`<slot name="icon"></slot>`}
</div>