Skip to content

Commit e977d53

Browse files
authored
Merge pull request #3114 from Laravel-Backpack/fix-3112
Fix #3112 - bulk clone now uses translation strings for error/success messages
2 parents d8742d6 + 012780c commit e977d53

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/resources/lang/en/crud.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
'admin' => 'Admin',
4646
'details_row' => 'This is the details row. Modify as you please.',
4747
'details_row_loading_error' => 'There was an error loading the details. Please retry.',
48-
'clone' => 'Clone',
49-
'clone_success' => '<strong>Entry cloned</strong><br>A new entry has been added, with the same information as this one.',
50-
'clone_failure' => '<strong>Cloning failed</strong><br>The new entry could not be created. Please try again.',
48+
'clone' => 'Clone',
49+
'clone_success' => '<strong>Entry cloned</strong><br>A new entry has been added, with the same information as this one.',
50+
'clone_failure' => '<strong>Cloning failed</strong><br>The new entry could not be created. Please try again.',
5151

5252
// Confirmation messages and bubbles
5353
'delete_confirm' => 'Are you sure you want to delete this item?',
@@ -62,13 +62,20 @@
6262
'bulk_no_entries_selected_title' => 'No entries selected',
6363
'bulk_no_entries_selected_message' => 'Please select one or more items to perform a bulk action on them.',
6464

65-
// Bulk confirmation
65+
// Bulk delete
6666
'bulk_delete_are_you_sure' => 'Are you sure you want to delete these :number entries?',
6767
'bulk_delete_sucess_title' => 'Entries deleted',
6868
'bulk_delete_sucess_message' => ' items have been deleted',
6969
'bulk_delete_error_title' => 'Delete failed',
7070
'bulk_delete_error_message' => 'One or more items could not be deleted',
7171

72+
// Bulk clone
73+
'bulk_clone_are_you_sure' => 'Are you sure you want to clone these :number entries?',
74+
'bulk_clone_sucess_title' => 'Entries cloned',
75+
'bulk_clone_sucess_message' => ' items have been cloned.',
76+
'bulk_clone_error_title' => 'Cloning failed',
77+
'bulk_clone_error_message' => 'One or more entries could not be created. Please try again.',
78+
7279
// Ajax errors
7380
'ajax_error_title' => 'Error',
7481
'ajax_error_text' => 'Error loading page. Please refresh the page.',

src/resources/views/crud/buttons/bulk_clone.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function bulkCloneEntries(button) {
1717
return;
1818
}
1919
20-
var message = "Are you sure you want to clone these :number entries?";
20+
var message = "{!! trans('backpack::crud.bulk_clone_are_you_sure') !!}";
2121
message = message.replace(":number", crud.checkedItems.length);
2222
2323
// show confirm message
@@ -54,7 +54,7 @@ className: "bg-primary",
5454
// Show an alert with the result
5555
new Noty({
5656
type: "success",
57-
text: "<strong>Entries cloned</strong><br>"+crud.checkedItems.length+" new entries have been added."
57+
text: "<strong>{!! trans('backpack::crud.bulk_clone_sucess_title') !!}</strong><br>"+crud.checkedItems.length+" {!! trans('backpack::crud.bulk_clone_sucess_message') !!}"
5858
}).show();
5959
6060
crud.checkedItems = [];
@@ -64,7 +64,7 @@ className: "bg-primary",
6464
// Show an alert with the result
6565
new Noty({
6666
type: "danger",
67-
text: "<strong>Cloning failed</strong><br>One or more entries could not be created. Please try again."
67+
text: "<strong>{!! trans('backpack::crud.bulk_clone_error_title') !!}</strong><br>"+crud.checkedItems.length+" {!! trans('backpack::crud.bulk_clone_error_message') !!}"
6868
}).show();
6969
}
7070
});

0 commit comments

Comments
 (0)