diff --git a/packages/Webkul/Ui/src/DataGrid/DataGrid.php b/packages/Webkul/Ui/src/DataGrid/DataGrid.php index aa431000b..d14842713 100644 --- a/packages/Webkul/Ui/src/DataGrid/DataGrid.php +++ b/packages/Webkul/Ui/src/DataGrid/DataGrid.php @@ -286,7 +286,7 @@ abstract class DataGrid $this->checkPermissions($action, $specialPermission, function ($action, $eventName) { $this->fireEvent('action.before.' . $eventName); - $action['key'] = Str::slug($action['title'], '_'); + $action['key'] = Str::slug($action['title'], '_', app()->getLocale()); $this->actions[] = $action; $this->enableAction = true; diff --git a/packages/Webkul/Ui/src/DataGrid/Traits/ProvideCollection.php b/packages/Webkul/Ui/src/DataGrid/Traits/ProvideCollection.php index e6a7de4c1..883dd865f 100644 --- a/packages/Webkul/Ui/src/DataGrid/Traits/ProvideCollection.php +++ b/packages/Webkul/Ui/src/DataGrid/Traits/ProvideCollection.php @@ -275,6 +275,7 @@ trait ProvideCollection if ($toDisplay) { $urlKey = $this->generateKeyFromActionTitle($action['title'], '_url'); + $record->$urlKey = route($action['route'], $record->{$action['index'] ?? $this->index}); } } @@ -306,7 +307,7 @@ trait ProvideCollection */ private function generateKeyFromActionTitle($title, $suffix) { - $validatedStrings = Str::slug($title, '_'); + $validatedStrings = Str::slug($title, '_', app()->getLocale()); return strtolower($validatedStrings) . $suffix; }