Skip to content

Commit 4fe60f3

Browse files
authored
Block Catalogue: Localizes block-type name/description before render (closes #20890) (#20904)
Block Catalogue: Localizes block-type name/description before render Fixes #20890.
1 parent 439c1dc commit 4fe60f3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Umbraco.Web.UI.Client/src/packages/block/block/modals/block-catalogue/block-catalogue-modal.element.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ export class UmbBlockCatalogueModalElement extends UmbModalBaseElement<
104104

105105
const lookup = items.reduce(
106106
(acc, item) => {
107-
acc[item.unique] = item;
107+
acc[item.unique] = {
108+
...item,
109+
name: this.localize.string(item.name),
110+
description: this.localize.string(item.description),
111+
};
108112
return acc;
109113
},
110114
{} as { [key: string]: UmbDocumentTypeItemModel },
@@ -244,8 +248,8 @@ export class UmbBlockCatalogueModalElement extends UmbModalBaseElement<
244248
return html`
245249
<uui-card-block-type
246250
href=${ifDefined(href)}
247-
name=${this.localize.string(block.name)}
248-
description=${this.localize.string(block.description)}
251+
name=${block.name}
252+
description=${ifDefined(block.description)}
249253
.background=${block.backgroundColor}
250254
@open=${() => this.#chooseBlock(block.contentElementTypeKey)}>
251255
${when(

0 commit comments

Comments
 (0)