Skip to content

Commit e9ac014

Browse files
committed
Removed the use of Auth facade and removed unnecesary option
1 parent 3bb9e5e commit e9ac014

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

.env.example

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ APP_CLEAR_TASKLOG=720
77
APP_DELETE_MINUTES=10
88
APP_ENVIRONMENT_ONLY=true
99
LOG_CHANNEL=daily
10-
1110
APP_LOCALE=en
12-
APP_LOCALE_IS_GLOBAL=false
1311

1412
DB_HOST=127.0.0.1
1513
DB_PORT=3306

app/Http/Middleware/LanguageMiddleware.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ public function __construct(Application $app, Repository $config)
4848
*/
4949
public function handle(Request $request, Closure $next)
5050
{
51-
if (! Auth::check() || $this->config->get('pterodactyl.lang.global')) {
52-
$this->app->setLocale($this->config->get('app.locale', 'en'));
53-
} else {
54-
$this->app->setLocale(Auth::user()->language);
55-
}
51+
$this->app->setLocale($request->user()->language ?? $this->config->get('app.locale'));
5652

5753
return $next($request);
5854
}

config/pterodactyl.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161
*/
162162
'lang' => [
163163
'in_context' => env('PHRASE_IN_CONTEXT', false),
164-
'global' => env('APP_LOCALE_IS_GLOBAL', false),
165164
],
166165

167166
/*

0 commit comments

Comments
 (0)