Skip to content

Commit

Permalink
Merge pull request #7 from EGYWEB-Mohamed/main
Browse files Browse the repository at this point in the history
Add `translate` inside Exception Catch by @EGYWEB-Mohamed
  • Loading branch information
afsakar authored Jan 28, 2024
2 parents 597ac90 + 93644e2 commit 9889490
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Actions/TranslatableAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ function (Field $component) {
} else {
$text = $component->getState();
}

$googleTranslate = $googleTranslate->translate($source, $data['target'], $text);


try {
$googleTranslate = $googleTranslate->translate($source, $data['target'], $text);
$component->state($googleTranslate);

$livewire->dispatch('refresh-tiptap-editors', [
Expand All @@ -66,7 +65,7 @@ function (Field $component) {
} catch (\Exception $exception) {
Notification::make()
->title(__('filament-translate-action::filament-translate-action.error_title'))
->body(__('filament-translate-action::filament-translate-action.error_message'))
->body(__('filament-translate-action::filament-translate-action.error_message'). '<br/>' . $exception->getMessage())
->danger()
->send();

Expand Down

0 comments on commit 9889490

Please sign in to comment.