Skip to content

Commit c1a8500

Browse files
authored
Tiptap RTE: Localizes property editor UI label (removes "[Tiptap]" from label) (closes #20439) (#20713)
* Localized RTE property-editor UI label, removing "[Tiptap]" * Updated acceptance test * Localized the button label in the data-type and property-editor picker modals * Based on @copilot suggestion, localized the property-editor UI label in the other places
1 parent cfa5304 commit c1a8500

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

src/Umbraco.Web.UI.Client/src/packages/core/property-editor/ui-picker-modal/property-editor-ui-picker-modal.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class UmbPropertyEditorUIPickerModalElement extends UmbModalBaseElement<
116116
<li class="item" ?selected=${this.value.selection.includes(propertyEditorUI.alias)}>
117117
<button type="button" @click=${() => this.#handleClick(propertyEditorUI)}>
118118
<umb-icon name=${propertyEditorUI.meta.icon} class="icon"></umb-icon>
119-
${propertyEditorUI.meta.label || propertyEditorUI.name}
119+
${this.localize.string(propertyEditorUI.meta.label || propertyEditorUI.name)}
120120
</button>
121121
</li>
122122
`,

src/Umbraco.Web.UI.Client/src/packages/data-type/modals/data-type-picker-flow/data-type-picker-flow-modal.element.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -347,30 +347,27 @@ export class UmbDataTypePickerFlowModalElement extends UmbModalBaseElement<
347347
}
348348

349349
#renderDataTypeButton(propertyEditorUI: ManifestPropertyEditorUi, createAsNewOnPick?: boolean) {
350+
const label = this.localize.string(propertyEditorUI.meta.label || propertyEditorUI.name);
350351
if (createAsNewOnPick) {
351352
return html`
352-
<uui-button
353-
label=${propertyEditorUI.meta.label || propertyEditorUI.name}
354-
@click=${() => this.#createDataType(propertyEditorUI.alias)}>
355-
${this.#renderItemContent(propertyEditorUI)}
353+
<uui-button label=${label} @click=${() => this.#createDataType(propertyEditorUI.alias)}>
354+
${this.#renderItemContent(label, propertyEditorUI)}
356355
</uui-button>
357356
`;
358357
} else {
359358
return html`
360-
<uui-button
361-
label=${propertyEditorUI.meta.label || propertyEditorUI.name}
362-
href=${this._dataTypePickerModalRouteBuilder!({ uiAlias: propertyEditorUI.alias })}>
363-
${this.#renderItemContent(propertyEditorUI)}
359+
<uui-button label=${label} href=${this._dataTypePickerModalRouteBuilder!({ uiAlias: propertyEditorUI.alias })}>
360+
${this.#renderItemContent(label, propertyEditorUI)}
364361
</uui-button>
365362
`;
366363
}
367364
}
368365

369-
#renderItemContent(propertyEditorUI: ManifestPropertyEditorUi) {
366+
#renderItemContent(label: string, propertyEditorUI: ManifestPropertyEditorUi) {
370367
return html`
371368
<div class="item-content">
372369
<umb-icon name=${propertyEditorUI.meta.icon} class="icon"></umb-icon>
373-
${propertyEditorUI.meta.label || propertyEditorUI.name}
370+
${label}
374371
</div>
375372
`;
376373
}

src/Umbraco.Web.UI.Client/src/packages/tiptap/property-editors/tiptap-rte/manifests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const manifests: Array<ManifestPropertyEditorUi> = [
77
name: 'Rich Text Editor [Tiptap] Property Editor UI',
88
element: () => import('./property-editor-ui-tiptap.element.js'),
99
meta: {
10-
label: 'Rich Text Editor [Tiptap]',
10+
label: '#rte_label',
1111
propertyEditorSchemaAlias: 'Umbraco.RichText',
1212
icon: 'icon-browser-window',
1313
group: 'richContent',

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/Tiptap.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test.afterEach(async ({umbracoApi}) => {
1515

1616
test('can create a rich text editor with tiptap', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
1717
// Arrange
18-
const tipTapLocatorName = 'Rich Text Editor [Tiptap]';
18+
const tipTapLocatorName = 'Rich Text Editor';
1919
const tipTapAlias = 'Umbraco.RichText';
2020
const tipTapUiAlias = 'Umb.PropertyEditorUi.Tiptap';
2121

0 commit comments

Comments
 (0)