Skip to content

Commit

Permalink
Simplify locales
Browse files Browse the repository at this point in the history
  • Loading branch information
lancepioch committed Mar 23, 2024
1 parent 08d9858 commit b8b4750
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/Settings/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function index(): View
{
return view('admin.settings.index', [
'version' => $this->versionService,
'languages' => $this->getAvailableLanguages(true),
'languages' => $this->getAvailableLanguages(),
]);
}

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Admin/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function index(Request $request): View
public function create(): View
{
return view('admin.users.new', [
'languages' => $this->getAvailableLanguages(true),
'languages' => $this->getAvailableLanguages(),
]);
}

Expand All @@ -71,7 +71,7 @@ public function view(User $user): View
{
return view('admin.users.view', [
'user' => $user,
'languages' => $this->getAvailableLanguages(true),
'languages' => $this->getAvailableLanguages(),
]);
}

Expand Down
4 changes: 2 additions & 2 deletions app/Traits/Helpers/AvailableLanguages.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ trait AvailableLanguages
* Return all the available languages on the Panel based on those
* that are present in the language folder.
*/
public function getAvailableLanguages(bool $localize = false): array
public function getAvailableLanguages(): array
{
return collect($this->getFilesystemInstance()->directories(base_path('lang')))->mapWithKeys(function ($path) use ($localize) {
return collect($this->getFilesystemInstance()->directories(base_path('lang')))->mapWithKeys(function ($path) {
$code = basename($path);

$value = Locale::getDisplayName($code, app()->currentLocale());
Expand Down

0 comments on commit b8b4750

Please sign in to comment.