Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 01966ed

Browse files
committed
fix: if a crop has a label itself, use that and run it through the localize controller
1 parent ed5d6b3 commit 01966ed

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/packages/media/media/components/input-image-cropper/image-cropper-preview.element.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import type { UmbImageCropperCrop, UmbImageCropperFocalPoint } from './index.js';
22
import { calculateExtrapolatedValue, clamp } from '@umbraco-cms/backoffice/utils';
3-
import { LitElement, css, html, nothing, customElement, property, query } from '@umbraco-cms/backoffice/external/lit';
3+
import { css, html, nothing, customElement, property, query } from '@umbraco-cms/backoffice/external/lit';
4+
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
45

56
@customElement('umb-image-cropper-preview')
6-
export class UmbImageCropperPreviewElement extends LitElement {
7+
export class UmbImageCropperPreviewElement extends UmbLitElement {
78
@query('#image') imageElement!: HTMLImageElement;
89
@query('#container') imageContainerElement!: HTMLImageElement;
910

@@ -150,7 +151,9 @@ export class UmbImageCropperPreviewElement extends LitElement {
150151
<div id="container">
151152
<img id="image" src=${this.src} alt="" />
152153
</div>
153-
<span id="alias">${this.label ?? this.crop.alias}</span>
154+
<span id="alias">
155+
${this.crop.label !== undefined ? this.localize.string(this.crop.label) : (this.label ?? this.crop.alias)}
156+
</span>
154157
<span id="dimensions">${this.crop.width} x ${this.crop.height}</span>
155158
${this.crop.coordinates
156159
? html`<span id="user-defined"><umb-localize key="imagecropper_customCrop">User defined</umb-localize></span>`

0 commit comments

Comments
 (0)