diff --git a/beike/Plugin/Plugin.php b/beike/Plugin/Plugin.php index 1e362a23..6f656fbb 100644 --- a/beike/Plugin/Plugin.php +++ b/beike/Plugin/Plugin.php @@ -152,11 +152,23 @@ class Plugin implements Arrayable, \ArrayAccess return $this->name; } + public function getLocaleName(): string + { + $currentLocale = locale(); + return is_array($this->name) ? ($this->name[$currentLocale] ?? '') : (string) $this->name; + } + public function getDescription(): string { return $this->description; } + public function getLocaleDescription(): string + { + $currentLocale = locale(); + return is_array($this->description) ? ($this->description[$currentLocale] ?? '') : (string) $this->description; + } + public function getDirname(): string { return $this->dirName; diff --git a/resources/beike/admin/views/pages/plugins/form.blade.php b/resources/beike/admin/views/pages/plugins/form.blade.php index 1e27294d..f8fd8d29 100644 --- a/resources/beike/admin/views/pages/plugins/form.blade.php +++ b/resources/beike/admin/views/pages/plugins/form.blade.php @@ -5,7 +5,7 @@ @section('content')
-
{{ $plugin->name }}
+
{{ $plugin->getLocaleName() }}
@if (session('success'))