Removed the use of Auth facade and removed unnecesary option

This commit is contained in:
stanjg 2018-06-01 16:10:32 +02:00
parent 3bb9e5e8a8
commit e9ac014bf4
No known key found for this signature in database
GPG key ID: 27D9DF9D28935303
3 changed files with 1 additions and 8 deletions

View file

@ -7,9 +7,7 @@ APP_CLEAR_TASKLOG=720
APP_DELETE_MINUTES=10 APP_DELETE_MINUTES=10
APP_ENVIRONMENT_ONLY=true APP_ENVIRONMENT_ONLY=true
LOG_CHANNEL=daily LOG_CHANNEL=daily
APP_LOCALE=en APP_LOCALE=en
APP_LOCALE_IS_GLOBAL=false
DB_HOST=127.0.0.1 DB_HOST=127.0.0.1
DB_PORT=3306 DB_PORT=3306

View file

@ -48,11 +48,7 @@ class LanguageMiddleware
*/ */
public function handle(Request $request, Closure $next) public function handle(Request $request, Closure $next)
{ {
if (! Auth::check() || $this->config->get('pterodactyl.lang.global')) { $this->app->setLocale($request->user()->language ?? $this->config->get('app.locale'));
$this->app->setLocale($this->config->get('app.locale', 'en'));
} else {
$this->app->setLocale(Auth::user()->language);
}
return $next($request); return $next($request);
} }

View file

@ -161,7 +161,6 @@ return [
*/ */
'lang' => [ 'lang' => [
'in_context' => env('PHRASE_IN_CONTEXT', false), 'in_context' => env('PHRASE_IN_CONTEXT', false),
'global' => env('APP_LOCALE_IS_GLOBAL', false),
], ],
/* /*