Skip to content

Patch: translatable for \Laravel\Nova\Actions\Actionable Status and Name field values #1703

@4n70w4

Description

@4n70w4
Index: vendor/laravel/nova/src/Actions/ActionResource.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- vendor/laravel/nova/src/Actions/ActionResource.php	(date 1561540466795)
+++ vendor/laravel/nova/src/Actions/ActionResource.php	(date 1561540466795)
@@ -64,7 +64,9 @@
     {
         return [
             ID::make('ID', 'id'),
-            Text::make(__('Action Name'), 'name'),
+            Text::make(__('Action Name'), 'name', function($value) {
+                return __($value);
+            }),
 
             Text::make(__('Action Initiated By'), function () {
                 return $this->user->name ?? $this->user->email ?? __('Nova User');
@@ -73,8 +75,8 @@
             MorphToActionTarget::make(__('Action Target'), 'target'),
 
             Status::make(__('Action Status'), 'status', function ($value) {
-                return ucfirst($value);
-            })->loadingWhen(['Waiting', 'Running'])->failedWhen(['Failed']),
+                return __(ucfirst($value));
+            })->loadingWhen([__('Waiting'), __('Running')])->failedWhen([__('Failed')]),
 
             $this->when(isset($this->original), function () {
                 return KeyValue::make(__('Original'));

Before:
image

After:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified bug by the Nova team

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions