diff --git a/resources/js/components/collections/Listing.vue b/resources/js/components/collections/Listing.vue index a9f83b98601..cf5a2df50df 100644 --- a/resources/js/components/collections/Listing.vue +++ b/resources/js/components/collections/Listing.vue @@ -55,7 +55,7 @@ :url="collection.create_entry_url" variant="default" :blueprints="collection.blueprints" - :text="__('Create Entry')" + :text="collection.create_label" size="sm" /> diff --git a/src/Entries/Collection.php b/src/Entries/Collection.php index 4042c035eca..098b09934e4 100644 --- a/src/Entries/Collection.php +++ b/src/Entries/Collection.php @@ -457,7 +457,7 @@ public function layout($layout = null) public function createLabel() { - $key = "messages.{$this->handle()}_collection_create_entry"; + $key = "statamic::messages.{$this->handle()}_collection_create_entry"; $translation = __($key); diff --git a/src/Http/Controllers/CP/Collections/CollectionsController.php b/src/Http/Controllers/CP/Collections/CollectionsController.php index 167fb0715ef..3b4c8dc59cb 100644 --- a/src/Http/Controllers/CP/Collections/CollectionsController.php +++ b/src/Http/Controllers/CP/Collections/CollectionsController.php @@ -87,6 +87,7 @@ private function collections() 'actions' => Action::for($collection), 'actions_url' => cp_route('collections.actions.run'), 'icon' => $collection->icon(), + 'create_label' => $collection->createLabel(), 'sort_column' => $collection->sortField(), 'sort_direction' => $collection->sortDirection(), ]; diff --git a/src/Taxonomies/Taxonomy.php b/src/Taxonomies/Taxonomy.php index 2b6315f01f9..90b0c91fdd7 100644 --- a/src/Taxonomies/Taxonomy.php +++ b/src/Taxonomies/Taxonomy.php @@ -454,7 +454,7 @@ public function layout($layout = null) public function createLabel() { - $key = "messages.{$this->handle()}_taxonomy_create_term"; + $key = "statamic::messages.{$this->handle()}_taxonomy_create_term"; $translation = __($key); diff --git a/tests/Feature/Collections/ViewCollectionListingTest.php b/tests/Feature/Collections/ViewCollectionListingTest.php index 28367a34c99..9aa866d12ce 100644 --- a/tests/Feature/Collections/ViewCollectionListingTest.php +++ b/tests/Feature/Collections/ViewCollectionListingTest.php @@ -59,6 +59,7 @@ public function it_shows_a_list_of_collections() 'actions' => Facades\Action::for($collectionA, ['view' => 'list']), 'actions_url' => 'http://localhost/cp/collections/actions', 'icon' => 'collections', + 'create_label' => 'Create Entry', 'sort_column' => 'title', 'sort_direction' => 'asc', 'filters' => Scope::filters('entries', [ @@ -93,6 +94,7 @@ public function it_shows_a_list_of_collections() 'actions' => Facades\Action::for($collectionB, ['view' => 'list']), 'actions_url' => 'http://localhost/cp/collections/actions', 'icon' => 'collections', + 'create_label' => 'Create Entry', 'sort_column' => 'title', 'sort_direction' => 'asc', 'filters' => Scope::filters('entries', [