浏览代码

Fix language definition in blade view

Bubka 2 年之前
父节点
当前提交
373ffa14c8
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 2 1
      app/Http/Controllers/SinglePageController.php
  2. 2 2
      resources/views/landing.blade.php

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

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

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

@@ -1,9 +1,9 @@
 <!DOCTYPE html>
-<html data-theme="{{ $userPreferences['theme'] }}" lang="{{ $userPreferences['lang'] }}">
+<html data-theme="{{ $userPreferences['theme'] }}" lang="{{ $lang }}">
 <head>
     <meta charset="utf-8">
     <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="csrf-token" content="{{csrf_token()}}">
     <meta name="robots" content="noindex, nofollow">