Block Catalogue: Localizes block-type name/description before render (closes #20890) (#20904)

Block Catalogue: Localizes block-type name/description before render

Fixes #20890.
This commit is contained in:
Lee Kelleher
2025-11-25 11:33:11 +01:00
committed by GitHub
parent 439c1dccd3
commit 4fe60f360f

View File

@@ -104,7 +104,11 @@ export class UmbBlockCatalogueModalElement extends UmbModalBaseElement<
const lookup = items.reduce( const lookup = items.reduce(
(acc, item) => { (acc, item) => {
acc[item.unique] = item; acc[item.unique] = {
...item,
name: this.localize.string(item.name),
description: this.localize.string(item.description),
};
return acc; return acc;
}, },
{} as { [key: string]: UmbDocumentTypeItemModel }, {} as { [key: string]: UmbDocumentTypeItemModel },
@@ -244,8 +248,8 @@ export class UmbBlockCatalogueModalElement extends UmbModalBaseElement<
return html` return html`
<uui-card-block-type <uui-card-block-type
href=${ifDefined(href)} href=${ifDefined(href)}
name=${this.localize.string(block.name)} name=${block.name}
description=${this.localize.string(block.description)} description=${ifDefined(block.description)}
.background=${block.backgroundColor} .background=${block.backgroundColor}
@open=${() => this.#chooseBlock(block.contentElementTypeKey)}> @open=${() => this.#chooseBlock(block.contentElementTypeKey)}>
${when( ${when(