修复插件多语言读取
This commit is contained in:
parent
a5191440c6
commit
63638f9588
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h6 class="border-bottom pb-3 mb-4">{{ $plugin->name }}</h6>
|
||||
<h6 class="border-bottom pb-3 mb-4">{{ $plugin->getLocaleName() }}</h6>
|
||||
|
||||
@if (session('success'))
|
||||
<x-admin-alert type="success" msg="{{ session('success') }}" class="mt-4"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue