From 4a81925231b6847f03afb978a592bff7dc5b0264 Mon Sep 17 00:00:00 2001 From: Mats Mikkel Rummelhoff Date: Fri, 19 Jun 2026 23:03:44 +0200 Subject: [PATCH] Capitalize first word in deletion blocker messages --- .../deletionblockers/RelationDeletionBlocker.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/elements/deletionblockers/RelationDeletionBlocker.php b/src/elements/deletionblockers/RelationDeletionBlocker.php index 3de8aff33d4..979fe5e9168 100644 --- a/src/elements/deletionblockers/RelationDeletionBlocker.php +++ b/src/elements/deletionblockers/RelationDeletionBlocker.php @@ -13,6 +13,7 @@ use craft\helpers\ArrayHelper; use craft\helpers\Cp; use craft\helpers\Html; +use craft\helpers\StringHelper; /** * Class RelationDeletionBlocker @@ -63,14 +64,14 @@ public function getSummary(): string /** @var class-string $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 @@ -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, - ]), + ])), ]), ], ];