diff --git a/app/Http/Controllers/ReportTemplatesController.php b/app/Http/Controllers/ReportTemplatesController.php index 56468403e8..684b9527cd 100644 --- a/app/Http/Controllers/ReportTemplatesController.php +++ b/app/Http/Controllers/ReportTemplatesController.php @@ -30,7 +30,7 @@ class ReportTemplatesController extends Controller if (!$reportTemplate) { return redirect()->route('reports/custom') - ->with('error', 'Template does not exist or you do not have permission to view it.'); //needs translation + ->with('error', trans('admin/reports/message.no_report_permission')); } $customfields = CustomField::get(); @@ -59,7 +59,7 @@ class ReportTemplatesController extends Controller if (!$reportTemplate) { return redirect()->route('reports/custom') - ->with('error', 'Template does not exist or you do not have permission to view it.'); + ->with('error', trans('admin/reports/message.no_report_permission')); } $reportTemplate->options = $request->except(['_token', 'name']); @@ -76,12 +76,12 @@ class ReportTemplatesController extends Controller if (!$reportTemplate) { return redirect()->route('reports/custom') - ->with('error', 'Template does not exist or you do not have permission to delete it.'); + ->with('error', trans('admin/reports/message.delete.no_delete_permission')); } $reportTemplate->delete(); return redirect()->route('reports/custom') - ->with('success', 'Template deleted.'); + ->with('success', trans('admin/reports/message.delete.delete_confirm')); } } diff --git a/resources/lang/en/admin/reports/message.php b/resources/lang/en/admin/reports/message.php index c52a2a003e..6c0c246183 100644 --- a/resources/lang/en/admin/reports/message.php +++ b/resources/lang/en/admin/reports/message.php @@ -2,6 +2,7 @@ return array( 'error' => 'You must select at least ONE option.', + 'no_report_permission' => 'Template does not exist or you do not have permission to view it.', 'create' => [ 'success' => 'Report saved successfully', @@ -9,7 +10,10 @@ return array( 'duplicate' => 'Report title already exists. Please choose a different one.', ], + 'delete' => [ 'delete' => 'Are you sure you want to delete this report?', - 'no_report_permission' => 'Template does not exist or you do not have permission to view it.', + 'delete_confirm' => 'Template deleted', + 'no_delete_permission' => 'Template does not exist or you do not have permission to delete it.', + ], );