Skip to content

Commit fe7db00

Browse files
authored
Property actions: adds localization support (#18323)
also streamlined the icon render code
1 parent b38ef14 commit fe7db00

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Umbraco.Web.UI.Client/src/packages/core/property-action/kinds/default/property-action.element.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type {
44
} from '../../property-action.extension.js';
55
import type { UmbPropertyAction } from '../../property-action.interface.js';
66
import { UmbActionExecutedEvent } from '@umbraco-cms/backoffice/event';
7-
import { html, customElement, property, state, ifDefined, nothing } from '@umbraco-cms/backoffice/external/lit';
7+
import { customElement, html, ifDefined, property, state, when } from '@umbraco-cms/backoffice/external/lit';
88
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
99
import type { UUIMenuItemEvent } from '@umbraco-cms/backoffice/external/uui';
1010

@@ -48,13 +48,11 @@ export class UmbPropertyActionElement<
4848
override render() {
4949
return html`
5050
<uui-menu-item
51-
label=${ifDefined(this.manifest?.meta.label)}
51+
label=${this.localize.string(this.manifest?.meta.label)}
5252
href=${ifDefined(this._href)}
5353
@click-label=${this.#onClickLabel}
5454
@click=${this.#onClick}>
55-
${this.manifest?.meta.icon
56-
? html`<umb-icon slot="icon" name="${this.manifest?.meta.icon}"></umb-icon>`
57-
: nothing}
55+
${when(this.manifest?.meta.icon, (icon) => html`<umb-icon slot="icon" name=${icon}></umb-icon>`)}
5856
</uui-menu-item>
5957
`;
6058
}

0 commit comments

Comments
 (0)