Skip to content

Commit

Permalink
adds translation string instead of hardcoded message
Browse files Browse the repository at this point in the history
  • Loading branch information
Godmartinz committed Jan 9, 2025
1 parent 082a974 commit 001ccf1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Listeners/CheckoutableListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ public function onCheckedOut($event)
}
} catch (ClientException $e) {
Log::error("ClientException caught during checkin notification: " . $e->getMessage());
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) . ' webhook notification failed: Check to make sure your URL is still valid.');
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) .trans('admin/settings/message.webhook.webhook_fail') );
} catch (Exception $e) {
Log::error(ucfirst(Setting::getSettings()->webhook_selected) . ' webhook notification failed:', [
'error' => $e->getMessage(),
'webhook_endpoint' => Setting::getSettings()->webhook_endpoint,
'event' => $event,
]);
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) . ' webhook notification failed: Check to make sure your URL is still valid.');
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) . trans('admin/settings/message.webhook.webhook_fail'));
}
}

Expand Down Expand Up @@ -197,14 +197,14 @@ public function onCheckedIn($event)
}
} catch (ClientException $e) {
Log::error("ClientException caught during checkin notification: " . $e->getMessage());
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) .' webhook notification failed: Check to make sure the URL is still valid.');
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) .trans('admin/settings/message.webhook.webhook_fail'));
} catch (Exception $e) {
Log::error(ucfirst(Setting::getSettings()->webhook_selected) . ' webhook notification failed:', [
'error' => $e->getMessage(),
'webhook_endpoint' => Setting::getSettings()->webhook_endpoint,
'event' => $event,
]);
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) . ' webhook notification failed: Check to make sure the URL is still valid.');
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) .trans('admin/settings/message.webhook.webhook_fail'));
}
}

Expand Down
1 change: 1 addition & 0 deletions resources/lang/en-US/admin/settings/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
'error' => 'Something went wrong. :app responded with: :error_message',
'error_redirect' => 'ERROR: 301/302 :endpoint returns a redirect. For security reasons, we don’t follow redirects. Please use the actual endpoint.',
'error_misc' => 'Something went wrong. :( ',
'webhook_fail' => ' webhook notification failed: Check to make sure the URL is still valid.',
]
];

0 comments on commit 001ccf1

Please sign in to comment.