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

Commit 00999fc

Browse files
Merge pull request #2154 from umbraco/v14/feature/doctype-ref-localizations
Feature: Document Type reference localizations
2 parents 8e80ea3 + 22ee68c commit 00999fc

File tree

15 files changed

+124
-99
lines changed

15 files changed

+124
-99
lines changed

src/assets/lang/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,6 +1562,7 @@ export default {
15621562
ascending: 'ascending',
15631563
descending: 'descending',
15641564
template: 'Template',
1565+
systemFields: 'System fields',
15651566
},
15661567
grid: {
15671568
media: 'Image',

src/packages/core/components/input-entity/input-entity.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class UmbInputEntityElement extends UmbFormControlMixin<string | undefine
148148
id="btn-add"
149149
look="placeholder"
150150
@click=${this.#openPicker}
151-
label="${this.localize.term('general_choose')}"></uui-button>
151+
label=${this.localize.term('general_choose')}></uui-button>
152152
`;
153153
}
154154

src/packages/core/content-type/modals/composition-picker/composition-picker-modal.element.ts

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,22 @@ export class UmbCompositionPickerModalElement extends UmbModalBaseElement<
130130
<div slot="actions">
131131
<uui-button label=${this.localize.term('general_close')} @click=${this._rejectModal}></uui-button>
132132
${!this._references.length
133-
? html`<uui-button
134-
label=${this.localize.term('general_submit')}
135-
look="primary"
136-
color="positive"
137-
@click=${this._submitModal}></uui-button>`
133+
? html`
134+
<uui-button
135+
label=${this.localize.term('general_submit')}
136+
look="primary"
137+
color="positive"
138+
@click=${this._submitModal}></uui-button>
139+
`
138140
: nothing}
139141
</div>
140142
</umb-body-layout>
141143
`;
142144
}
143145

144146
#renderHasReference() {
145-
return html` <umb-localize key="contentTypeEditor_compositionInUse">
147+
return html`
148+
<umb-localize key="contentTypeEditor_compositionInUse">
146149
This Content Type is used in a composition, and therefore cannot be composed itself.
147150
</umb-localize>
148151
<h4>
@@ -155,19 +158,22 @@ export class UmbCompositionPickerModalElement extends UmbModalBaseElement<
155158
${repeat(
156159
this._references,
157160
(item) => item.unique,
158-
(item) =>
159-
html`<uui-ref-node-document-type
161+
(item) => html`
162+
<uui-ref-node-document-type
160163
href=${'/section/settings/workspace/document-type/edit/' + item.unique}
161-
name=${item.name}>
164+
name=${this.localize.string(item.name)}>
162165
<umb-icon slot="icon" name=${item.icon}></umb-icon>
163-
</uui-ref-node-document-type>`,
166+
</uui-ref-node-document-type>
167+
`,
164168
)}
165-
</div>`;
169+
</div>
170+
`;
166171
}
167172

168173
#renderAvailableCompositions() {
169174
if (this._compatibleCompositions) {
170-
return html`<umb-localize key="contentTypeEditor_compositionsDescription">
175+
return html`
176+
<umb-localize key="contentTypeEditor_compositionsDescription">
171177
Inherit tabs and properties from an existing Document Type. New tabs will be<br />added to the current
172178
Document Type or merged if a tab with an identical name exists.<br />
173179
</umb-localize>
@@ -185,27 +191,31 @@ export class UmbCompositionPickerModalElement extends UmbModalBaseElement<
185191
: nothing}
186192
${this.#renderCompositionsItems(folder.compositions)}`,
187193
)}
188-
</div>`;
194+
</div>
195+
`;
189196
} else {
190-
return html`<umb-localize key="contentTypeEditor_noAvailableCompositions">
191-
There are no Content Types available to use as a composition
192-
</umb-localize>`;
197+
return html`
198+
<umb-localize key="contentTypeEditor_noAvailableCompositions">
199+
There are no Content Types available to use as a composition
200+
</umb-localize>
201+
`;
193202
}
194203
}
195204

196205
#renderCompositionsItems(compositionsList: Array<UmbContentTypeCompositionCompatibleModel>) {
197206
return repeat(
198207
compositionsList,
199208
(compositions) => compositions.unique,
200-
(compositions) =>
201-
html`<uui-menu-item
202-
label=${compositions.name}
209+
(compositions) => html`
210+
<uui-menu-item
211+
label=${this.localize.string(compositions.name)}
203212
selectable
204213
@selected=${() => this.#onSelectionAdd(compositions.unique)}
205214
@deselected=${() => this.#onSelectionRemove(compositions.unique)}
206215
?selected=${this._selection.find((unique) => unique === compositions.unique)}>
207216
<umb-icon name=${compositions.icon} slot="icon"></umb-icon>
208-
</uui-menu-item>`,
217+
</uui-menu-item>
218+
`,
209219
);
210220
}
211221

src/packages/core/content-type/workspace/views/design/content-type-design-editor.element.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -416,14 +416,16 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements
416416
return html`
417417
<div id="actions">
418418
${this._compositionRepositoryAlias
419-
? html` <uui-button
420-
look="outline"
421-
label=${this.localize.term('contentTypeEditor_compositions')}
422-
compact
423-
@click=${this.#openCompositionModal}>
424-
<uui-icon name="icon-merge"></uui-icon>
425-
${this.localize.term('contentTypeEditor_compositions')}
426-
</uui-button>`
419+
? html`
420+
<uui-button
421+
look="outline"
422+
label=${this.localize.term('contentTypeEditor_compositions')}
423+
compact
424+
@click=${this.#openCompositionModal}>
425+
<uui-icon name="icon-merge"></uui-icon>
426+
${this.localize.term('contentTypeEditor_compositions')}
427+
</uui-button>
428+
`
427429
: ''}
428430
<uui-button look="outline" label=${sortButtonText} compact @click=${this.#toggleSortMode}>
429431
<uui-icon name="icon-navigation"></uui-icon>

src/packages/core/content/workspace/views/edit/content-editor-tab.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class UmbContentWorkspaceViewEditTabElement extends UmbLitElement {
6363
this._groups,
6464
(group) => group.id,
6565
(group) =>
66-
html`<uui-box .headline=${group.name ?? ''}>
66+
html`<uui-box .headline=${this.localize.string(group.name) ?? ''}>
6767
<umb-content-workspace-view-edit-properties
6868
class="properties"
6969
.containerId=${group.id}></umb-content-workspace-view-edit-properties>

src/packages/core/content/workspace/views/edit/content-editor.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements
138138
(tab) => {
139139
const path = this._routerPath + '/tab/' + encodeFolderName(tab.name || '');
140140
return html`<uui-tab label=${tab.name ?? 'Unnamed'} .active=${path === this._activePath} href=${path}
141-
>${tab.name}</uui-tab
141+
>${this.localize.string(tab.name)}</uui-tab
142142
>`;
143143
},
144144
)}

src/packages/core/modal/common/item-picker/item-picker-modal.element.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class UmbItemPickerModalElement extends UmbModalBaseElement<UmbItemPicker
5151
if (!this.data) return nothing;
5252
const items = this._filtered;
5353
return html`
54-
<umb-body-layout headline=${this.data.headline}>
54+
<umb-body-layout headline=${this.localize.string(this.data.headline)}>
5555
<div id="main">
5656
<uui-input
5757
type="search"
@@ -72,7 +72,7 @@ export class UmbItemPickerModalElement extends UmbModalBaseElement<UmbItemPicker
7272
(item) => item.value,
7373
(item) => html`
7474
<umb-ref-item
75-
name=${item.label}
75+
name=${this.localize.string(item.label)}
7676
detail=${ifDefined(item.description)}
7777
icon=${ifDefined(item.icon)}
7878
@click=${() => this.#submit(item)}>

src/packages/data-type/workspace/views/info/data-type-workspace-view-info-reference.element.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ export class UmbDataTypeWorkspaceViewInfoReferenceElement extends UmbLitElement
8787
(item) => html`
8888
<uui-table-row>
8989
<uui-table-cell>
90-
<uui-ref-node-document-type href=${this.#getEditPath(item)} name=${item.name ?? item.unique}>
90+
<uui-ref-node-document-type
91+
href=${this.#getEditPath(item)}
92+
name=${this.localize.string(item.name ?? item.unique)}>
9193
<umb-icon slot="icon" name=${item.icon ?? 'icon-document'}></umb-icon>
9294
</uui-ref-node-document-type>
9395
</uui-table-cell>

src/packages/documents/document-types/components/input-document-type/input-document-type.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export class UmbInputDocumentTypeElement extends UmbFormControlMixin<string | un
204204
if (!item.unique) return;
205205
const href = `${this._editPath}edit/${item.unique}`;
206206
return html`
207-
<uui-ref-node-document-type name=${item.name} id=${item.unique}>
207+
<uui-ref-node-document-type name=${this.localize.string(item.name)} id=${item.unique}>
208208
${this.#renderIcon(item)}
209209
<uui-action-bar slot="actions">
210210
<uui-button href=${href} label=${this.localize.term('general_open')}></uui-button>

src/packages/documents/documents/entity-actions/create/document-create-options-modal.element.ts

Lines changed: 56 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -133,60 +133,65 @@ export class UmbDocumentCreateOptionsModalElement extends UmbModalBaseElement<
133133
}
134134

135135
#renderDocumentTypes() {
136-
return html`<uui-box .headline=${this._headline}>
137-
${when(
138-
this._allowedDocumentTypes.length === 0,
139-
() => html`
140-
<umb-localize key="create_noDocumentTypes">
141-
There are no allowed Document Types available for creating content here. You must enable these in
142-
<strong>Document Types</strong> within the <strong>Settings</strong> section, by editing the
143-
<strong>Allowed child node types</strong> under <strong>Permissions</strong>.<br />
144-
</umb-localize>
145-
<uui-button
146-
id="edit-permissions"
147-
look="secondary"
148-
@click=${() => this._rejectModal()}
149-
href=${`/section/settings/workspace/document-type/edit/${this.data?.documentType?.unique}/view/structure`}
150-
label=${this.localize.term('create_noDocumentTypesEditPermissions')}></uui-button>
151-
`,
152-
() =>
153-
repeat(
154-
this._allowedDocumentTypes,
155-
(documentType) => documentType.unique,
156-
(documentType) =>
157-
html` <uui-ref-node-document-type
158-
data-id=${ifDefined(documentType.unique)}
159-
.name=${documentType.name}
160-
.alias=${documentType.description ?? ''}
161-
select-only
162-
selectable
163-
@selected=${() => this.#onSelectDocumentType(documentType.unique)}>
164-
<umb-icon slot="icon" name=${documentType.icon || 'icon-circle-dotted'}></umb-icon>
165-
</uui-ref-node-document-type>`,
166-
),
167-
)}
168-
</uui-box>`;
136+
return html`
137+
<uui-box .headline=${this._headline}>
138+
${when(
139+
this._allowedDocumentTypes.length === 0,
140+
() => html`
141+
<umb-localize key="create_noDocumentTypes">
142+
There are no allowed Document Types available for creating content here. You must enable these in
143+
<strong>Document Types</strong> within the <strong>Settings</strong> section, by editing the
144+
<strong>Allowed child node types</strong> under <strong>Permissions</strong>.<br />
145+
</umb-localize>
146+
<uui-button
147+
id="edit-permissions"
148+
look="secondary"
149+
href=${`/section/settings/workspace/document-type/edit/${this.data?.documentType?.unique}/view/structure`}
150+
label=${this.localize.term('create_noDocumentTypesEditPermissions')}
151+
@click=${() => this._rejectModal()}></uui-button>
152+
`,
153+
() =>
154+
repeat(
155+
this._allowedDocumentTypes,
156+
(documentType) => documentType.unique,
157+
(documentType) => html`
158+
<uui-ref-node-document-type
159+
data-id=${ifDefined(documentType.unique)}
160+
.name=${this.localize.string(documentType.name)}
161+
.alias=${this.localize.string(documentType.description ?? '')}
162+
select-only
163+
selectable
164+
@selected=${() => this.#onSelectDocumentType(documentType.unique)}>
165+
<umb-icon slot="icon" name=${documentType.icon || 'icon-circle-dotted'}></umb-icon>
166+
</uui-ref-node-document-type>
167+
`,
168+
),
169+
)}
170+
</uui-box>
171+
`;
169172
}
170173

171174
#renderBlueprints() {
172-
return html`<uui-box headline=${this.localize.term('blueprints_selectBlueprint')}>
173-
<uui-menu-item
174-
id="blank"
175-
label=${this.localize.term('blueprints_blankBlueprint')}
176-
@click=${() => this.#onNavigate(this.#documentTypeUnique)}>
177-
<umb-icon slot="icon" name=${this.#documentTypeIcon}></umb-icon>
178-
</uui-menu-item>
179-
${repeat(
180-
this._availableBlueprints,
181-
(blueprint) => blueprint.unique,
182-
(blueprint) =>
183-
html`<uui-menu-item
184-
label=${blueprint.name}
185-
@click=${() => this.#onNavigate(this.#documentTypeUnique, blueprint.unique)}>
186-
<umb-icon slot="icon" name="icon-blueprint"></umb-icon>
187-
</uui-menu-item>`,
188-
)}</uui-box
189-
> `;
175+
return html`
176+
<uui-box headline=${this.localize.term('blueprints_selectBlueprint')}>
177+
<uui-menu-item
178+
id="blank"
179+
label=${this.localize.term('blueprints_blankBlueprint')}
180+
@click=${() => this.#onNavigate(this.#documentTypeUnique)}>
181+
<umb-icon slot="icon" name=${this.#documentTypeIcon}></umb-icon>
182+
</uui-menu-item>
183+
${repeat(
184+
this._availableBlueprints,
185+
(blueprint) => blueprint.unique,
186+
(blueprint) =>
187+
html`<uui-menu-item
188+
label=${blueprint.name}
189+
@click=${() => this.#onNavigate(this.#documentTypeUnique, blueprint.unique)}>
190+
<umb-icon slot="icon" name="icon-blueprint"></umb-icon>
191+
</uui-menu-item>`,
192+
)}
193+
</uui-box>
194+
`;
190195
}
191196

192197
static override styles = [

0 commit comments

Comments
 (0)