Browse Source

Fix language definition in blade view

Bubka 2 years ago
parent
commit
373ffa14c8

+ 2 - 1
app/Http/Controllers/SinglePageController.php

@@ -4,8 +4,8 @@ namespace App\Http\Controllers;
 
 
 use App\Events\ScanForNewReleaseCalled;
 use App\Events\ScanForNewReleaseCalled;
 use App\Facades\Settings;
 use App\Facades\Settings;
-use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\App;
 use Illuminate\Support\Facades\App;
+use Illuminate\Support\Facades\Auth;
 
 
 class SinglePageController extends Controller
 class SinglePageController extends Controller
 {
 {
@@ -31,6 +31,7 @@ class SinglePageController extends Controller
             'subdirectory'    => $subdir,
             'subdirectory'    => $subdir,
             'isDemoApp'       => config('2fauth.config.isDemoApp') ? 'true' : 'false',
             'isDemoApp'       => config('2fauth.config.isDemoApp') ? 'true' : 'false',
             'isTestingApp'    => config('2fauth.config.isTestingApp') ? 'true' : 'false',
             'isTestingApp'    => config('2fauth.config.isTestingApp') ? 'true' : 'false',
+            'lang'            => App::getLocale(),
             'locales'         => collect(config('2fauth.locales'))->toJson(), /** @phpstan-ignore-line */
             'locales'         => collect(config('2fauth.locales'))->toJson(), /** @phpstan-ignore-line */
         ]);
         ]);
     }
     }

+ 2 - 2
resources/views/landing.blade.php

@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
-<html data-theme="{{ $userPreferences['theme'] }}" lang="{{ $userPreferences['lang'] }}">
+<html data-theme="{{ $userPreferences['theme'] }}" lang="{{ $lang }}">
 <head>
 <head>
     <meta charset="utf-8">
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="description" content="{{ __('commons.2fauth_description') }}" lang="{{ $userPreferences['lang'] }}">
+    <meta name="description" content="{{ __('commons.2fauth_description') }}" lang="{{ $lang }}">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0, shrink-to-fit=no, viewport-fit=cover">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0, shrink-to-fit=no, viewport-fit=cover">
     <meta name="csrf-token" content="{{csrf_token()}}">
     <meta name="csrf-token" content="{{csrf_token()}}">
     <meta name="robots" content="noindex, nofollow">
     <meta name="robots" content="noindex, nofollow">