diff --git a/CHANGELOG.md b/CHANGELOG.md index 890a20be00b..acb434b32a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Fixed a bug where custom fields were getting included in rendered field layout forms, even if their `getInputHtml()` method returned an empty string. - Fixed a bug where the password input on the Set Password page wasn’t including the “Show” button. - Fixed a SQL error that could occur if an element was saved with a title longer than 255 characters. +- Fixed a bug where some UI messages began with a lowercase letter in some languages. ([#16354](https://github.com/craftcms/cms/issues/16354)) - Fixed errors that could occur when working with field layouts for element types that are no longer installed. ([#16352](https://github.com/craftcms/cms/issues/16352)) - Fixed an error that could occur when creating nested entries within Matrix fields. ([#16331](https://github.com/craftcms/cms/issues/16331)) - Fixed a bug where element index View menus could include a “Use defaults” button when no view customizations had been made. diff --git a/src/base/Element.php b/src/base/Element.php index 1fbb5b3a357..deb587e66ff 100644 --- a/src/base/Element.php +++ b/src/base/Element.php @@ -1054,9 +1054,9 @@ public static function actions(string $source): array if (!$hasActionType(Edit::class)) { $actions->prepend([ 'type' => Edit::class, - 'label' => Craft::t('app', 'Edit {type}', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Edit {type}', [ 'type' => static::lowerDisplayName(), - ]), + ])), ]); } @@ -1064,9 +1064,9 @@ public static function actions(string $source): array if (static::hasUris() && !$hasActionType(ViewAction::class)) { $actions->prepend([ 'type' => ViewAction::class, - 'label' => Craft::t('app', 'View {type}', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'View {type}', [ 'type' => static::lowerDisplayName(), - ]), + ])), ]); } @@ -3795,9 +3795,9 @@ protected function safeActionMenuItems(): array $items[] = [ 'id' => $editId, 'icon' => 'edit', - 'label' => Craft::t('app', 'Edit {type}', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Edit {type}', [ 'type' => static::lowerDisplayName(), - ]), + ])), ]; $view = Craft::$app->getView(); @@ -3882,9 +3882,9 @@ protected function destructiveActionMenuItems(): array if ($canDeleteForSite) { $items[] = [ 'icon' => 'remove', - 'label' => Craft::t('app', 'Delete {type} for this site', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type} for this site', [ 'type' => $isUnpublishedDraft ? Craft::t('app', 'draft') : static::lowerDisplayName(), - ]), + ])), 'action' => 'elements/delete-for-site', 'params' => [ 'elementId' => $this->getCanonicalId(), @@ -3902,9 +3902,9 @@ protected function destructiveActionMenuItems(): array if ($canDeleteCanonical) { $items[] = [ 'icon' => 'trash', - 'label' => Craft::t('app', 'Delete {type}', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type}', [ 'type' => $isUnpublishedDraft ? Craft::t('app', 'draft') : static::lowerDisplayName(), - ]), + ])), 'action' => $isUnpublishedDraft ? 'elements/delete-draft' : 'elements/delete', 'params' => [ 'elementId' => $this->getCanonicalId(), @@ -3922,9 +3922,9 @@ protected function destructiveActionMenuItems(): array if ($canDeleteForSite) { $items[] = [ 'icon' => 'remove', - 'label' => Craft::t('app', 'Delete {type} for this site', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type} for this site', [ 'type' => Craft::t('app', 'draft'), - ]), + ])), 'action' => 'elements/delete-for-site', 'params' => [ 'elementId' => $this->getCanonicalId(), @@ -3942,9 +3942,9 @@ protected function destructiveActionMenuItems(): array // Delete draft $items[] = [ 'icon' => 'trash', - 'label' => Craft::t('app', 'Delete {type}', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type}', [ 'type' => Craft::t('app', 'draft'), - ]), + ])), 'action' => 'elements/delete-draft', 'params' => [ 'elementId' => $this->getCanonicalId(), diff --git a/src/controllers/AssetsController.php b/src/controllers/AssetsController.php index 462fe881a87..3466a5b3e34 100644 --- a/src/controllers/AssetsController.php +++ b/src/controllers/AssetsController.php @@ -203,9 +203,9 @@ public function actionSaveAsset(): ?Response if (!Craft::$app->getElements()->saveElement($asset)) { return $this->asModelFailure( $asset, - Craft::t('app', 'Couldn’t save {type}.', [ + StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => Asset::lowerDisplayName(), - ]), + ])), $assetVariable ); } diff --git a/src/controllers/CategoriesController.php b/src/controllers/CategoriesController.php index 22afb46b3cc..8e8927af6e7 100644 --- a/src/controllers/CategoriesController.php +++ b/src/controllers/CategoriesController.php @@ -13,6 +13,7 @@ use craft\errors\InvalidElementException; use craft\helpers\Cp; use craft\helpers\ElementHelper; +use craft\helpers\StringHelper; use craft\helpers\UrlHelper; use craft\models\CategoryGroup; use craft\models\CategoryGroup_SiteSettings; @@ -279,9 +280,9 @@ public function actionCreate(string $groupHandle): ?Response // Save it $category->setScenario(Element::SCENARIO_ESSENTIALS); if (!Craft::$app->getDrafts()->saveElementAsDraft($category, Craft::$app->getUser()->getId(), null, null, false)) { - return $this->asModelFailure($category, Craft::t('app', 'Couldn’t create {type}.', [ + return $this->asModelFailure($category, StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t create {type}.', [ 'type' => Category::lowerDisplayName(), - ]), 'category'); + ])), 'category'); } // Set its position in the structure if a before/after param was passed @@ -370,9 +371,9 @@ public function actionSaveCategory(): ?Response if (!Craft::$app->getElements()->saveElement($category)) { return $this->asModelFailure( $category, - Craft::t('app', 'Couldn’t save {type}.', [ + StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => Category::lowerDisplayName(), - ]), + ])), $categoryVariable ); } diff --git a/src/controllers/ElementsController.php b/src/controllers/ElementsController.php index b075dad18d2..05f72ac0864 100644 --- a/src/controllers/ElementsController.php +++ b/src/controllers/ElementsController.php @@ -210,9 +210,9 @@ public function actionCreate(): Response // Save it $element->setScenario(Element::SCENARIO_ESSENTIALS); if (!Craft::$app->getDrafts()->saveElementAsDraft($element, $user->id, null, null, false)) { - return $this->_asFailure($element, Craft::t('app', 'Couldn’t create {type}.', [ + return $this->_asFailure($element, StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t create {type}.', [ 'type' => $element::lowerDisplayName(), - ])); + ]))); } // Redirect to its edit page @@ -454,9 +454,9 @@ public function actionEdit(?ElementInterface $element, ?int $elementId = null): if ($isUnpublishedDraft) { if ($canSaveCanonical) { $response - ->submitButtonLabel(Craft::t('app', 'Create {type}', [ + ->submitButtonLabel(StringHelper::upperCaseFirst(Craft::t('app', 'Create {type}', [ 'type' => $element::lowerDisplayName(), - ])) + ]))) ->action('elements/apply-draft') ->redirectUrl("$redirectUrl#"); } else { @@ -470,9 +470,9 @@ public function actionEdit(?ElementInterface $element, ?int $elementId = null): ->redirectUrl("$redirectUrl#"); } elseif ($isDraft) { $response - ->submitButtonLabel(Craft::t('app', 'Save {type}', [ + ->submitButtonLabel(StringHelper::upperCaseFirst(Craft::t('app', 'Save {type}', [ 'type' => Craft::t('app', 'draft'), - ])) + ]))) ->action('elements/save-draft') ->redirectUrl("{cpEditUrl}"); } else { @@ -512,9 +512,9 @@ public function actionEdit(?ElementInterface $element, ?int $elementId = null): } if ($canSaveCanonical && $isUnpublishedDraft) { - $response->addAltAction(Craft::t('app', 'Save {type}', [ + $response->addAltAction(StringHelper::upperCaseFirst(Craft::t('app', 'Save {type}', [ 'type' => Craft::t('app', 'draft'), - ]), [ + ])), [ 'action' => 'elements/save-draft', 'redirect' => "$redirectUrl#", 'eventData' => ['autosave' => false], @@ -1271,9 +1271,9 @@ public function actionSave(): ?Response } if (!$success) { - return $this->_asFailure($element, Craft::t('app', 'Couldn’t save {type}.', [ + return $this->_asFailure($element, StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => $element::lowerDisplayName(), - ])); + ]))); } $elementsService->trackActivity($element, ElementActivity::TYPE_SAVE); @@ -1410,9 +1410,9 @@ public function actionSaveNestedElementForDerivative(): ?Response if (!$success) { $transaction->rollBack(); - return $this->_asFailure($element, Craft::t('app', 'Couldn’t save {type}.', [ + return $this->_asFailure($element, StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => $element::lowerDisplayName(), - ])); + ]))); } if ($element->getIsDraft()) { @@ -1675,9 +1675,9 @@ public function actionSaveDraft(): ?Response if (!$elementsService->saveElement($element)) { $transaction->rollBack(); - return $this->_asFailure($element, Craft::t('app', 'Couldn’t save {type}.', [ + return $this->_asFailure($element, StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => Craft::t('app', 'draft'), - ])); + ]))); } $transaction->commit(); @@ -1895,13 +1895,13 @@ public function actionApplyDraft(): ?Response private function _asAppyDraftFailure(ElementInterface $element): ?Response { if ($element->getIsUnpublishedDraft()) { - $message = Craft::t('app', 'Couldn’t create {type}.', [ + $message = StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t create {type}.', [ 'type' => $element::lowerDisplayName(), - ]); + ])); } elseif ($element->isProvisionalDraft) { - $message = Craft::t('app', 'Couldn’t save {type}.', [ + $message = StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => $element::lowerDisplayName(), - ]); + ])); } else { $message = Craft::t('app', 'Couldn’t apply draft.'); } diff --git a/src/controllers/EntriesController.php b/src/controllers/EntriesController.php index e2cf3014af7..dae524233b3 100644 --- a/src/controllers/EntriesController.php +++ b/src/controllers/EntriesController.php @@ -21,6 +21,7 @@ use craft\helpers\DateTimeHelper; use craft\helpers\ElementHelper; use craft\helpers\Html; +use craft\helpers\StringHelper; use craft\helpers\UrlHelper; use craft\models\Section; use craft\models\Section_SiteSettings; @@ -187,9 +188,9 @@ public function actionCreate(?string $section = null): ?Response DateTimeHelper::resume(); if (!$success) { - return $this->asModelFailure($entry, Craft::t('app', 'Couldn’t create {type}.', [ + return $this->asModelFailure($entry, StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t create {type}.', [ 'type' => Entry::lowerDisplayName(), - ]), 'entry'); + ])), 'entry'); } // Set its position in the structure if a before/after param was passed diff --git a/src/controllers/GlobalsController.php b/src/controllers/GlobalsController.php index b8e45000349..565137aa48b 100644 --- a/src/controllers/GlobalsController.php +++ b/src/controllers/GlobalsController.php @@ -12,6 +12,7 @@ use craft\elements\GlobalSet; use craft\helpers\Cp; use craft\helpers\Json; +use craft\helpers\StringHelper; use craft\web\Controller; use yii\web\BadRequestHttpException; use yii\web\ForbiddenHttpException; @@ -79,9 +80,9 @@ public function actionSaveSet(): ?Response // Save it if (!Craft::$app->getGlobals()->saveSet($globalSet)) { - $this->setFailFlash(Craft::t('app', 'Couldn’t save {type}.', [ + $this->setFailFlash(StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => GlobalSet::lowerDisplayName(), - ])); + ]))); // Send the global set back to the template Craft::$app->getUrlManager()->setRouteParams([ @@ -221,9 +222,9 @@ public function actionSaveContent(): ?Response $globalSet->setScenario(Element::SCENARIO_LIVE); if (!Craft::$app->getElements()->saveElement($globalSet)) { - $this->setFailFlash(Craft::t('app', 'Couldn’t save {type}.', [ + $this->setFailFlash(StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => GlobalSet::lowerDisplayName(), - ])); + ]))); // Send the global set back to the template Craft::$app->getUrlManager()->setRouteParams([ diff --git a/src/controllers/MatrixController.php b/src/controllers/MatrixController.php index 04eb514d8e3..4473fed27f3 100644 --- a/src/controllers/MatrixController.php +++ b/src/controllers/MatrixController.php @@ -119,9 +119,9 @@ public function actionCreateEntry(): Response $entry->setScenario(Element::SCENARIO_ESSENTIALS); if (!Craft::$app->getDrafts()->saveElementAsDraft($entry, $user->id, markAsSaved: false)) { - return $this->asFailure(Craft::t('app', 'Couldn’t create {type}.', [ + return $this->asFailure(StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t create {type}.', [ 'type' => Entry::lowerDisplayName(), - ])); + ]))); } /** @var EntryQuery|ElementCollection $value */ diff --git a/src/controllers/SystemSettingsController.php b/src/controllers/SystemSettingsController.php index b8eb9f72f5b..78d4a5a6c95 100644 --- a/src/controllers/SystemSettingsController.php +++ b/src/controllers/SystemSettingsController.php @@ -15,6 +15,7 @@ use craft\helpers\Component; use craft\helpers\Html; use craft\helpers\MailerHelper; +use craft\helpers\StringHelper; use craft\helpers\UrlHelper; use craft\mail\Mailer; use craft\mail\transportadapters\BaseTransportAdapter; @@ -260,9 +261,9 @@ public function actionGlobalSetIndex(): Response ], ], 'globalSets' => Craft::$app->getGlobals()->getAllSets(), - 'buttonLabel' => Craft::t('app', 'New {type}', [ + 'buttonLabel' => StringHelper::upperCaseFirst(Craft::t('app', 'New {type}', [ 'type' => GlobalSet::lowerDisplayName(), - ]), + ])), ]); } diff --git a/src/controllers/UsersController.php b/src/controllers/UsersController.php index 489020b5ac2..7b620f4c63f 100644 --- a/src/controllers/UsersController.php +++ b/src/controllers/UsersController.php @@ -33,6 +33,7 @@ use craft\helpers\Image; use craft\helpers\Json; use craft\helpers\Session; +use craft\helpers\StringHelper; use craft\helpers\UrlHelper; use craft\helpers\User as UserHelper; use craft\i18n\Locale; @@ -728,9 +729,9 @@ public function actionRequirePasswordReset(): ?Response $user->passwordResetRequired = true; if (!Craft::$app->getElements()->saveElement($user, false)) { - return $this->asFailure(Craft::t('app', 'Couldn’t save {type}.', [ + return $this->asFailure(StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => User::lowerDisplayName(), - ])); + ]))); } return $this->asSuccess(Craft::t('app', '{type} saved.', [ @@ -758,9 +759,9 @@ public function actionRemovePasswordResetRequirement(): ?Response $user->passwordResetRequired = false; if (!Craft::$app->getElements()->saveElement($user, false)) { - return $this->asFailure(Craft::t('app', 'Couldn’t save {type}.', [ + return $this->asFailure(StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => User::lowerDisplayName(), - ])); + ]))); } return $this->asSuccess(Craft::t('app', '{type} saved.', [ @@ -935,9 +936,9 @@ public function actionEnableUser(): ?Response $user->archived = false; if (!$elementsService->saveElement($user, false)) { - return $this->asFailure(Craft::t('app', 'Couldn’t save {type}.', [ + return $this->asFailure(StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => User::lowerDisplayName(), - ])); + ]))); } return $this->asSuccess(Craft::t('app', '{type} saved.', [ @@ -994,9 +995,9 @@ public function actionIndex(?string $source = null): Response $this->requirePermission('editUsers'); return $this->renderTemplate('users/_index.twig', [ 'title' => Craft::t('app', 'Users'), - 'buttonLabel' => Craft::t('app', 'New {type}', [ + 'buttonLabel' => StringHelper::upperCaseFirst(Craft::t('app', 'New {type}', [ 'type' => User::lowerDisplayName(), - ]), + ])), 'source' => $source, ]); } @@ -1020,9 +1021,9 @@ public function actionCreate(): Response $user->setScenario(Element::SCENARIO_ESSENTIALS); if (!Craft::$app->getDrafts()->saveElementAsDraft($user, Craft::$app->getUser()->getId(), null, null, false)) { - return $this->asModelFailure($user, Craft::t('app', 'Couldn’t create {type}.', [ + return $this->asModelFailure($user, StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t create {type}.', [ 'type' => User::lowerDisplayName(), - ]), 'user'); + ])), 'user'); } $editUrl = $user->getCpEditUrl(); @@ -1634,9 +1635,9 @@ public function actionSaveUser(): ?Response return $this->asModelFailure( $user, - Craft::t('app', 'Couldn’t save {type}.', [ + StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => User::lowerDisplayName(), - ]), + ])), $userVariable ); } @@ -2201,9 +2202,9 @@ public function actionSaveAddress(): ?Response $address->setFieldValuesFromRequest($fieldsLocation); if (!$elementsService->saveElement($address)) { - return $this->asModelFailure($address, Craft::t('app', 'Couldn’t save {type}.', [ + return $this->asModelFailure($address, StringHelper::upperCaseFirst(Craft::t('app', 'Couldn’t save {type}.', [ 'type' => Address::lowerDisplayName(), - ]), 'address'); + ])), 'address'); } return $this->asModelSuccess($address, Craft::t('app', '{type} saved.', [ diff --git a/src/elements/NestedElementManager.php b/src/elements/NestedElementManager.php index 91110fb9567..c81be14953a 100644 --- a/src/elements/NestedElementManager.php +++ b/src/elements/NestedElementManager.php @@ -369,9 +369,9 @@ public function getCardsHtml(?ElementInterface $owner, array $config = []): stri self::VIEW_MODE_CARDS, function(string $id, array $config, $attribute, &$settings) use ($owner) { $settings += [ - 'deleteLabel' => Craft::t('app', 'Delete {type}', [ + 'deleteLabel' => StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type}', [ 'type' => $this->elementType::lowerDisplayName(), - ]), + ])), 'deleteConfirmationMessage' => Craft::t('app', 'Are you sure you want to delete the selected {type}?', [ 'type' => $this->elementType::lowerDisplayName(), ]), diff --git a/src/elements/User.php b/src/elements/User.php index b6fcbdb63b1..46e797bba4d 100644 --- a/src/elements/User.php +++ b/src/elements/User.php @@ -2070,9 +2070,9 @@ protected function destructiveActionMenuItems(): array $items[] = [ 'id' => $deleteId, 'icon' => 'trash', - 'label' => Craft::t('app', 'Delete {type}', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type}', [ 'type' => static::lowerDisplayName(), - ]), + ])), ]; $view->registerJsWithVars(fn($id, $userId, $redirect) => << Craft::t('app', 'Selectable {type} Condition', [ 'type' => $elementType::pluralDisplayName(), ]), - 'instructions' => Craft::t('app', 'Only allow {type} to be selected if they match the following rules:', [ + 'instructions' => StringHelper::upperCaseFirst(Craft::t('app', 'Only allow {type} to be selected if they match the following rules:', [ 'type' => $elementType::pluralLowerDisplayName(), - ]), + ])), ]); } diff --git a/src/services/UserPermissions.php b/src/services/UserPermissions.php index 086f8221ef7..a9b75df86d5 100644 --- a/src/services/UserPermissions.php +++ b/src/services/UserPermissions.php @@ -23,6 +23,7 @@ use craft\events\UserPermissionsEvent; use craft\helpers\Db; use craft\helpers\ProjectConfig as ProjectConfigHelper; +use craft\helpers\StringHelper; use craft\models\Section; use craft\models\UserGroup; use craft\records\UserPermission as UserPermissionRecord; @@ -432,9 +433,9 @@ private function _userPermissions(array &$permissions): void 'heading' => Craft::t('app', 'Users'), 'permissions' => [ 'editUsers' => [ - 'label' => Craft::t('app', 'Edit {type}', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Edit {type}', [ 'type' => User::pluralLowerDisplayName(), - ]), + ])), 'nested' => array_merge( array_filter([ 'registerUsers' => [ @@ -507,20 +508,20 @@ private function _entryPermissions(array &$permissions): void if ($section->type == Section::TYPE_SINGLE) { $sectionPermissions = [ "viewEntries:$section->uid" => [ - 'label' => Craft::t('app', 'View {type}', ['type' => $type]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'View {type}', ['type' => $type])), 'nested' => [ "saveEntries:$section->uid" => [ - 'label' => Craft::t('app', 'Save {type}', ['type' => $type]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Save {type}', ['type' => $type])), ], "viewPeerEntryDrafts:$section->uid" => [ - 'label' => Craft::t('app', 'View other users’ {type}', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'View other users’ {type}', [ 'type' => Craft::t('app', 'drafts'), - ]), + ])), 'nested' => [ "savePeerEntryDrafts:$section->uid" => [ - 'label' => Craft::t('app', 'Save other users’ {type}', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Save other users’ {type}', [ 'type' => Craft::t('app', 'drafts'), - ]), + ])), ], "deletePeerEntryDrafts:$section->uid" => [ 'label' => Craft::t('app', 'Delete other users’ {type}', [ @@ -535,29 +536,29 @@ private function _entryPermissions(array &$permissions): void } else { $sectionPermissions = [ "viewEntries:$section->uid" => [ - 'label' => Craft::t('app', 'View {type}', ['type' => $pluralType]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'View {type}', ['type' => $pluralType])), 'info' => Craft::t('app', 'Allows viewing existing {type} and creating drafts for them.', [ 'type' => $pluralType, ]), 'nested' => [ "createEntries:$section->uid" => [ - 'label' => Craft::t('app', 'Create {type}', ['type' => $pluralType]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Create {type}', ['type' => $pluralType])), 'info' => Craft::t('app', 'Allows creating drafts of new {type}.', ['type' => $pluralType]), ], "saveEntries:$section->uid" => [ - 'label' => Craft::t('app', 'Save {type}', ['type' => $pluralType]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Save {type}', ['type' => $pluralType])), 'info' => Craft::t('app', 'Allows fully saving canonical {type} (directly or by applying drafts).', [ 'type' => $pluralType, ]), ], "deleteEntries:$section->uid" => [ - 'label' => Craft::t('app', 'Delete {type}', ['type' => $pluralType]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type}', ['type' => $pluralType])), ], "viewPeerEntries:$section->uid" => [ - 'label' => Craft::t('app', 'View other users’ {type}', ['type' => $pluralType]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'View other users’ {type}', ['type' => $pluralType])), 'nested' => [ "savePeerEntries:$section->uid" => [ - 'label' => Craft::t('app', 'Save other users’ {type}', ['type' => $pluralType]), + 'label' => StringHelper::lowercaseFirst(Craft::t('app', 'Save other users’ {type}', ['type' => $pluralType])), ], "deletePeerEntries:$section->uid" => [ 'label' => Craft::t('app', 'Delete other users’ {type}', ['type' => $pluralType]), @@ -565,14 +566,14 @@ private function _entryPermissions(array &$permissions): void ], ], "viewPeerEntryDrafts:$section->uid" => [ - 'label' => Craft::t('app', 'View other users’ {type}', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'View other users’ {type}', [ 'type' => Craft::t('app', 'drafts'), - ]), + ])), 'nested' => [ "savePeerEntryDrafts:$section->uid" => [ - 'label' => Craft::t('app', 'Save other users’ {type}', [ + 'label' => StringHelper::lowercaseFirst(Craft::t('app', 'Save other users’ {type}', [ 'type' => Craft::t('app', 'drafts'), - ]), + ])), ], "deletePeerEntryDrafts:$section->uid" => [ 'label' => Craft::t('app', 'Delete other users’ {type}', [ @@ -636,23 +637,23 @@ private function _categoryPermissions(array &$permissions): void ]), 'permissions' => [ "viewCategories:$group->uid" => [ - 'label' => Craft::t('app', 'View {type}', ['type' => $type]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'View {type}', ['type' => $type])), 'nested' => [ "saveCategories:$group->uid" => [ - 'label' => Craft::t('app', 'Save {type}', ['type' => $type]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Save {type}', ['type' => $type])), ], "deleteCategories:$group->uid" => [ - 'label' => Craft::t('app', 'Delete {type}', ['type' => $type]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type}', ['type' => $type])), ], "viewPeerCategoryDrafts:$group->uid" => [ - 'label' => Craft::t('app', 'View other users’ {type}', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'View other users’ {type}', [ 'type' => Craft::t('app', 'drafts'), - ]), + ])), 'nested' => [ "savePeerCategoryDrafts:$group->uid" => [ - 'label' => Craft::t('app', 'Save other users’ {type}', [ + 'label' => StringHelper::lowercaseFirst(Craft::t('app', 'Save other users’ {type}', [ 'type' => Craft::t('app', 'drafts'), - ]), + ])), ], "deletePeerCategoryDrafts:$group->uid" => [ 'label' => Craft::t('app', 'Delete other users’ {type}', [ @@ -685,13 +686,13 @@ private function _volumePermissions(array &$permissions): void ]), 'permissions' => [ "viewAssets:$volume->uid" => [ - 'label' => Craft::t('app', 'View {type}', ['type' => $type]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'View {type}', ['type' => $type])), 'nested' => [ "saveAssets:$volume->uid" => [ - 'label' => Craft::t('app', 'Save {type}', ['type' => $type]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Save {type}', ['type' => $type])), ], "deleteAssets:$volume->uid" => [ - 'label' => Craft::t('app', 'Delete {type}', ['type' => $type]), + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type}', ['type' => $type])), ], "replaceFiles:$volume->uid" => [ 'label' => Craft::t('app', 'Replace files'), diff --git a/src/web/assets/cp/dist/cp.js b/src/web/assets/cp/dist/cp.js index 539a3da33c3..2e3e284807e 100644 --- a/src/web/assets/cp/dist/cp.js +++ b/src/web/assets/cp/dist/cp.js @@ -1,3 +1,3 @@ /*! For license information please see cp.js.LICENSE.txt */ -(function(){var __webpack_modules__={463:function(){Craft.Accordion=Garnish.Base.extend({$trigger:null,targetSelector:null,_$target:null,init:function(t){var e=this;this.$trigger=$(t),this.$trigger.data("accordion")&&(console.warn("Double-instantiating an accordion trigger on an element"),this.$trigger.data("accordion").destroy()),this.$trigger.data("accordion",this),this.targetSelector=this.$trigger.attr("aria-controls")?"#".concat(this.$trigger.attr("aria-controls")):null,this.targetSelector&&(this._$target=$(this.targetSelector)),this.addListener(this.$trigger,"click","onTriggerClick"),this.addListener(this.$trigger,"keypress",(function(t){var n=t.keyCode;n!==Garnish.SPACE_KEY&&n!==Garnish.RETURN_KEY||(t.preventDefault(),e.onTriggerClick())}))},onTriggerClick:function(){"true"===this.$trigger.attr("aria-expanded")?this.hideTarget(this._$target):this.showTarget(this._$target)},showTarget:function(t){var e=this;if(t&&t.length){this.showTarget._currentHeight=t.height(),t.removeClass("hidden"),this.$trigger.removeClass("collapsed").addClass("expanded").attr("aria-expanded","true");for(var n=0;n=this.settings.maxItems)){var e=$(t).appendTo(this.$tbody),n=e.find(".delete");this.settings.sortable&&this.sorter.addItems(e),this.$deleteBtns=this.$deleteBtns.add(n),this.addListener(n,"click","handleDeleteBtnClick"),this.totalItems++,this.updateUI()}},reorderItems:function(){var t=this;if(this.settings.sortable){for(var e=[],n=0;n=this.settings.maxItems?$(this.settings.newItemBtnSelector).addClass("hidden"):$(this.settings.newItemBtnSelector).removeClass("hidden"))}},{defaults:{tableSelector:null,noItemsSelector:null,newItemBtnSelector:null,idAttribute:"data-id",nameAttribute:"data-name",sortable:!1,allowDeleteAll:!0,minItems:0,maxItems:null,reorderAction:null,deleteAction:null,reorderSuccessMessage:Craft.t("app","New order saved."),reorderFailMessage:Craft.t("app","Couldn’t save new order."),confirmDeleteMessage:Craft.t("app","Are you sure you want to delete “{name}”?"),deleteSuccessMessage:Craft.t("app","“{name}” deleted."),deleteFailMessage:Craft.t("app","Couldn’t delete “{name}”."),onReorderItems:$.noop,onDeleteItem:$.noop}})},6872:function(){Craft.AssetImageEditor=Garnish.Modal.extend({$body:null,$footer:null,$imageTools:null,$buttons:null,$cancelBtn:null,$replaceBtn:null,$saveBtn:null,$focalPointBtn:null,$editorContainer:null,$straighten:null,$croppingCanvas:null,$spinner:null,$constraintContainer:null,$constraintRadioInputs:null,$customConstraints:null,canvas:null,image:null,viewport:null,focalPoint:null,focalPointInnerCircle:null,focalPointOuterCircle:null,focalPointPickedIndicator:null,grid:null,croppingCanvas:null,clipper:null,croppingRectangle:null,cropperHandles:null,cropperGrid:null,croppingShade:null,imageStraightenAngle:0,viewportRotation:0,originalWidth:0,originalHeight:0,imageVerticeCoords:null,zoomRatio:1,animationInProgress:!1,currentView:"",assetId:null,cacheBust:null,draggingCropper:!1,scalingCropper:!1,handleClicked:!1,draggingFocal:!1,focalPickedUp:!1,focalClicked:!1,cropperClicked:!1,previousMouseX:0,previousMouseY:0,shiftKeyHeld:!1,editorHeight:0,editorWidth:0,cropperState:!1,scaleFactor:1,flipData:{},focalPointState:!1,maxImageSize:null,lastLoadedDimensions:null,imageIsLoading:!1,mouseMoveEvent:null,croppingConstraint:!1,constraintOrientation:"landscape",showingCustomConstraint:!1,saving:!1,renderImage:null,renderCropper:null,_queue:null,init:function(t,e){var n=this;this._queue=new Craft.Queue,this.cacheBust=Date.now(),this.setSettings(e,Craft.AssetImageEditor.defaults),null===this.settings.allowDegreeFractions&&(this.settings.allowDegreeFractions=Craft.isImagick),Garnish.prefersReducedMotion()&&(this.settings.animationDuration=1),this.assetId=t,this.flipData={x:0,y:0},this.$container=$('').appendTo(Garnish.$bod),this.$body=$('
').appendTo(this.$container),this.$footer=$('