From 583fcbcae4cac95e831e2e28e728a9296b261db9 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Fri, 27 Dec 2024 13:36:05 -0800 Subject: [PATCH 1/2] Missing `@deprecated` [ci skip] --- src/web/twig/Extension.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/web/twig/Extension.php b/src/web/twig/Extension.php index 10388a51a95..d838889bc30 100644 --- a/src/web/twig/Extension.php +++ b/src/web/twig/Extension.php @@ -468,6 +468,7 @@ public function ucfirstFilter(mixed $string): string * @param TwigEnvironment $env * @param string $string * @return string + * @deprecated in 3.5.0 */ public function ucwordsFilter(TwigEnvironment $env, string $string): string { From 5755af3cca5f0dfc26ec78662a9174e4d0a252d4 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Fri, 27 Dec 2024 14:29:15 -0800 Subject: [PATCH 2/2] Capitalize the first letter of strings that start with {type} in German --- CHANGELOG.md | 1 + src/base/Element.php | 8 +-- src/controllers/AssetsController.php | 4 +- src/controllers/CategoriesController.php | 9 ++-- src/controllers/ElementsController.php | 48 ++++++++--------- src/controllers/EntriesController.php | 5 +- src/controllers/GlobalsController.php | 9 ++-- src/controllers/SystemSettingsController.php | 5 +- src/controllers/UsersController.php | 17 +++--- src/fields/BaseRelationField.php | 4 +- src/services/UserPermissions.php | 57 ++++++++++---------- src/web/assets/cp/dist/cp.js | 2 +- src/web/assets/cp/dist/cp.js.map | 2 +- src/web/assets/cp/src/js/CategoryIndex.js | 16 +++--- src/web/assets/cp/src/js/ElementEditor.js | 24 +++++---- src/web/assets/cp/src/js/EntryIndex.js | 16 +++--- 16 files changed, 123 insertions(+), 104 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abcf648300c..a86e6d32085 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,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 an RCE vulnerability. ## 4.13.7 - 2024-12-17 diff --git a/src/base/Element.php b/src/base/Element.php index 3c2a5251ae0..17704bf9edd 100644 --- a/src/base/Element.php +++ b/src/base/Element.php @@ -989,9 +989,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(), - ]), + ])), ]); } @@ -999,9 +999,9 @@ public static function actions(string $source): array if (static::hasUris() && !$hasActionType(View::class)) { $actions->prepend([ 'type' => View::class, - 'label' => Craft::t('app', 'View {type}', [ + 'label' => StringHelper::upperCaseFirst(Craft::t('app', 'View {type}', [ 'type' => static::lowerDisplayName(), - ]), + ])), ]); } diff --git a/src/controllers/AssetsController.php b/src/controllers/AssetsController.php index 3e1ff173cd9..643cf2e8648 100644 --- a/src/controllers/AssetsController.php +++ b/src/controllers/AssetsController.php @@ -202,9 +202,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 b219d41284c..8ea05f17785 100644 --- a/src/controllers/ElementsController.php +++ b/src/controllers/ElementsController.php @@ -208,9 +208,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 @@ -457,9 +457,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 { @@ -473,9 +473,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 { @@ -516,9 +516,9 @@ public function actionEdit(?ElementInterface $element, ?int $elementId = null): if ($canSaveCanonical) { if ($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], @@ -532,9 +532,9 @@ public function actionEdit(?ElementInterface $element, ?int $elementId = null): } if ($canDeleteForSite) { - $response->addAltAction(Craft::t('app', 'Delete {type} for this site', [ + $response->addAltAction(StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type} for this site', [ 'type' => $isUnpublishedDraft ? Craft::t('app', 'draft') : $type, - ]), [ + ])), [ 'destructive' => true, 'action' => 'elements/delete-for-site', 'redirect' => "$redirectUrl#", @@ -545,9 +545,9 @@ public function actionEdit(?ElementInterface $element, ?int $elementId = null): } if ($canDeleteCanonical) { - $response->addAltAction(Craft::t('app', 'Delete {type}', [ + $response->addAltAction(StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type}', [ 'type' => $isUnpublishedDraft ? Craft::t('app', 'draft') : $type, - ]), [ + ])), [ 'destructive' => true, 'action' => $isUnpublishedDraft ? 'elements/delete-draft' : 'elements/delete', 'redirect' => "$redirectUrl#", @@ -558,9 +558,9 @@ public function actionEdit(?ElementInterface $element, ?int $elementId = null): } } elseif ($isDraft && $canDeleteDraft) { if ($canDeleteForSite) { - $response->addAltAction(Craft::t('app', 'Delete {type} for this site', [ + $response->addAltAction(StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type} for this site', [ 'type' => Craft::t('app', 'draft'), - ]), [ + ])), [ 'destructive' => true, 'action' => 'elements/delete-for-site', 'redirect' => "$redirectUrl#", @@ -568,9 +568,9 @@ public function actionEdit(?ElementInterface $element, ?int $elementId = null): ]); } - $response->addAltAction(Craft::t('app', 'Delete {type}', [ + $response->addAltAction(StringHelper::upperCaseFirst(Craft::t('app', 'Delete {type}', [ 'type' => Craft::t('app', 'draft'), - ]), [ + ])), [ 'destructive' => true, 'action' => 'elements/delete-draft', 'redirect' => $canonical->getCpEditUrl(), @@ -1150,9 +1150,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); @@ -1402,9 +1402,9 @@ public function actionSaveDraft(): ?Response $element->setScenario(Element::SCENARIO_ESSENTIALS); if (!$elementsService->saveElement($element)) { - 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'), - ])); + ]))); } $elementsService->trackActivity($element, ElementActivity::TYPE_SAVE); @@ -1556,13 +1556,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 ae5c3b9806d..99243048f6e 100644 --- a/src/controllers/EntriesController.php +++ b/src/controllers/EntriesController.php @@ -17,6 +17,7 @@ use craft\helpers\Cp; use craft\helpers\DateTimeHelper; use craft\helpers\ElementHelper; +use craft\helpers\StringHelper; use craft\helpers\UrlHelper; use craft\models\Section; use craft\models\Section_SiteSettings; @@ -177,9 +178,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/SystemSettingsController.php b/src/controllers/SystemSettingsController.php index 33db0007d00..aa5ee8faf7e 100644 --- a/src/controllers/SystemSettingsController.php +++ b/src/controllers/SystemSettingsController.php @@ -14,6 +14,7 @@ use craft\helpers\ArrayHelper; use craft\helpers\Component; use craft\helpers\MailerHelper; +use craft\helpers\StringHelper; use craft\helpers\UrlHelper; use craft\mail\Mailer; use craft\mail\transportadapters\BaseTransportAdapter; @@ -259,9 +260,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 b2c9abb5615..26a35e8ae5c 100644 --- a/src/controllers/UsersController.php +++ b/src/controllers/UsersController.php @@ -31,6 +31,7 @@ use craft\helpers\Html; use craft\helpers\Image; use craft\helpers\Session; +use craft\helpers\StringHelper; use craft\helpers\UrlHelper; use craft\helpers\User as UserHelper; use craft\i18n\Locale; @@ -756,9 +757,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.', [ @@ -815,9 +816,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, ]); } @@ -1500,9 +1501,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 ); } @@ -2084,9 +2085,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/fields/BaseRelationField.php b/src/fields/BaseRelationField.php index c8e8f1be66a..507ce5e0738 100644 --- a/src/fields/BaseRelationField.php +++ b/src/fields/BaseRelationField.php @@ -1189,9 +1189,9 @@ protected function settingsTemplateVariables(): array 'label' => 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 0ed4fdd28d8..2891f97ebcb 100644 --- a/src/services/UserPermissions.php +++ b/src/services/UserPermissions.php @@ -22,6 +22,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; @@ -410,9 +411,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( [ 'registerUsers' => [ @@ -481,20 +482,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}', [ @@ -509,29 +510,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]), @@ -539,14 +540,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}', [ @@ -610,23 +611,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}', [ @@ -659,13 +660,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 0bde0cd209c..869ab0d4a01 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 i=t.keyCode;i!==Garnish.SPACE_KEY&&i!==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 i=0;i .address-card");for(var n=0;n=this.settings.maxItems)){var e=$(t).appendTo(this.$tbody),i=e.find(".delete");this.settings.sortable&&this.sorter.addItems(e),this.$deleteBtns=this.$deleteBtns.add(i),this.addListener(i,"click","handleDeleteBtnClick"),this.totalItems++,this.updateUI()}},reorderItems:function(){var t=this;if(this.settings.sortable){for(var e=[],i=0;i=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,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,draggingFocal:!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 i=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=$('