Merge pull request #2120 from umbraco/v14/bugfix/document-collection-create-localize
Bugfix: Localizes collection create action labels
This commit is contained in:
@@ -65,17 +65,16 @@ export class UmbCollectionActionButtonElement extends UmbLitElement {
|
||||
}
|
||||
|
||||
override render() {
|
||||
const label = this.manifest?.meta.label ? this.localize.string(this.manifest.meta.label) : this.manifest?.name;
|
||||
return html`
|
||||
<uui-button
|
||||
id="action-button"
|
||||
@click=${this._onClick}
|
||||
look="outline"
|
||||
color="default"
|
||||
label=${ifDefined(
|
||||
this.manifest?.meta.label ? this.localize.string(this.manifest.meta.label) : this.manifest?.name,
|
||||
)}
|
||||
href="${ifDefined(this.manifest?.meta.href)}"
|
||||
.state=${this._buttonState}></uui-button>
|
||||
look="outline"
|
||||
label=${ifDefined(label)}
|
||||
href=${ifDefined(this.manifest?.meta.href)}
|
||||
.state=${this._buttonState}
|
||||
@click=${this._onClick}></uui-button>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ManifestCollection } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import type { Observable } from '@umbraco-cms/backoffice/external/rxjs';
|
||||
import type { ManifestCollection } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import type { UmbPaginationManager } from '@umbraco-cms/backoffice/utils';
|
||||
|
||||
export interface UmbCollectionBulkActionPermissions {
|
||||
|
||||
@@ -9,7 +9,7 @@ export const createManifest: ManifestCollectionAction = {
|
||||
alias: 'Umb.CollectionAction.Dictionary.Create',
|
||||
weight: 200,
|
||||
meta: {
|
||||
label: 'Create',
|
||||
label: '#general_create',
|
||||
href: `section/dictionary/workspace/dictionary/create/parent/${UMB_DICTIONARY_ROOT_ENTITY_TYPE}/null`,
|
||||
},
|
||||
conditions: [
|
||||
|
||||
@@ -112,7 +112,12 @@ export class UmbCreateDocumentCollectionActionElement extends UmbLitElement {
|
||||
if (this._allowedDocumentTypes.length !== 1) return;
|
||||
|
||||
const item = this._allowedDocumentTypes[0];
|
||||
const label = (this.manifest?.meta.label ?? this.localize.term('general_create')) + ' ' + item.name;
|
||||
const label =
|
||||
(this.manifest?.meta.label
|
||||
? this.localize.string(this.manifest?.meta.label)
|
||||
: this.localize.term('general_create')) +
|
||||
' ' +
|
||||
item.name;
|
||||
|
||||
return html`
|
||||
<uui-button color="default" href=${this.#getCreateUrl(item)} label=${label} look="outline"></uui-button>
|
||||
@@ -122,7 +127,9 @@ export class UmbCreateDocumentCollectionActionElement extends UmbLitElement {
|
||||
#renderDropdown() {
|
||||
if (!this._allowedDocumentTypes.length) return;
|
||||
|
||||
const label = this.manifest?.meta.label ?? this.localize.term('general_create');
|
||||
const label = this.manifest?.meta.label
|
||||
? this.localize.string(this.manifest?.meta.label)
|
||||
: this.localize.term('general_create');
|
||||
|
||||
return html`
|
||||
<uui-button popovertarget="collection-action-menu-popover" label=${label} color="default" look="outline">
|
||||
|
||||
@@ -9,7 +9,7 @@ export const createManifest: ManifestCollectionAction = {
|
||||
element: () => import('./create-document-collection-action.element.js'),
|
||||
weight: 100,
|
||||
meta: {
|
||||
label: 'Create',
|
||||
label: '#general_create',
|
||||
},
|
||||
conditions: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ export const createManifest: ManifestCollectionAction = {
|
||||
alias: 'Umb.CollectionAction.Language.Create',
|
||||
weight: 200,
|
||||
meta: {
|
||||
label: 'Create',
|
||||
label: '#general_create',
|
||||
href: 'section/settings/workspace/language/create',
|
||||
},
|
||||
conditions: [
|
||||
|
||||
@@ -106,7 +106,12 @@ export class UmbCreateMediaCollectionActionElement extends UmbLitElement {
|
||||
if (this._allowedMediaTypes.length !== 1) return;
|
||||
|
||||
const item = this._allowedMediaTypes[0];
|
||||
const label = (this.manifest?.meta.label ?? this.localize.term('general_create')) + ' ' + item.name;
|
||||
const label =
|
||||
(this.manifest?.meta.label
|
||||
? this.localize.string(this.manifest?.meta.label)
|
||||
: this.localize.term('general_create')) +
|
||||
' ' +
|
||||
item.name;
|
||||
|
||||
return html`<uui-button
|
||||
color="default"
|
||||
@@ -119,8 +124,8 @@ export class UmbCreateMediaCollectionActionElement extends UmbLitElement {
|
||||
if (!this._allowedMediaTypes.length) return;
|
||||
|
||||
const label = this.manifest?.meta.label
|
||||
? this.localize.string(this.manifest.meta.label)
|
||||
: this.manifest?.name ?? '';
|
||||
? this.localize.string(this.manifest?.meta.label)
|
||||
: this.localize.term('general_create');
|
||||
|
||||
return html`
|
||||
<uui-button popovertarget="collection-action-menu-popover" label=${label} color="default" look="outline">
|
||||
|
||||
@@ -8,7 +8,7 @@ export const createManifest: ManifestCollectionAction = {
|
||||
alias: 'Umb.CollectionAction.Webhook.Create',
|
||||
weight: 200,
|
||||
meta: {
|
||||
label: 'Create',
|
||||
label: '#general_create',
|
||||
href: 'section/settings/workspace/webhook/create',
|
||||
},
|
||||
conditions: [
|
||||
|
||||
Reference in New Issue
Block a user