Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/elements/deletionblockers/RelationDeletionBlocker.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use craft\helpers\ArrayHelper;
use craft\helpers\Cp;
use craft\helpers\Html;
use craft\helpers\StringHelper;

/**
* Class RelationDeletionBlocker
Expand Down Expand Up @@ -63,14 +64,14 @@ public function getSummary(): string
/** @var class-string<ElementInterface> $targetElementType */
$targetElementType = $this->elements->first()::class;

return Craft::t('app', 'The {numTargets, plural, =1{{targetTypeSingular} is} other{{targetTypePlural} are}} related by {numRelations, number} other {numRelations, plural, =1{{sourceTypeSingular}} other{{sourceTypePlural}}}.', [
return StringHelper::upperCaseFirst(Craft::t('app', 'The {numTargets, plural, =1{{targetTypeSingular} is} other{{targetTypePlural} are}} related by {numRelations, number} other {numRelations, plural, =1{{sourceTypeSingular}} other{{sourceTypePlural}}}.', [
'sourceTypeSingular' => $this->sourceElementType::lowerDisplayName(),
'sourceTypePlural' => $this->sourceElementType::pluralLowerDisplayName(),
'targetTypeSingular' => $targetElementType::lowerDisplayName(),
'targetTypePlural' => $targetElementType::pluralLowerDisplayName(),
'numRelations' => $this->relationCount,
'numTargets' => $this->elements->count(),
]);
]));
}

public function getDetails(): ?string
Expand Down Expand Up @@ -134,12 +135,12 @@ public function getActions(): array
'numRelations' => $this->relationCount,
]),
'callback' => Html::jsWithVars(fn($message) => "resolve($message);", [
Craft::t('app', 'The {numRelations, plural, =1{relation} other {relations}} will be removed once the {numTargets, plural, =1{{targetTypeSingular} is} other{{targetTypePlural} are}} deleted.', [
StringHelper::upperCaseFirst(Craft::t('app', 'The {numRelations, plural, =1{relation} other {relations}} will be removed once the {numTargets, plural, =1{{targetTypeSingular} is} other{{targetTypePlural} are}} deleted.', [
'targetTypeSingular' => $targetElementType::lowerDisplayName(),
'targetTypePlural' => $targetElementType::pluralLowerDisplayName(),
'numRelations' => $this->relationCount,
'numTargets' => $numTargets,
]),
])),
]),
],
];
Expand Down
Loading