Add support of the Accept_language header for UI localization

This commit is contained in:
Bubka
2021-12-03 22:50:28 +01:00
parent fbe91cc90e
commit 9f574feada
8 changed files with 92 additions and 12 deletions

View File

@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Services\SettingService;
use Illuminate\Support\Facades\App;
class SinglePageController extends Controller
{
@ -31,7 +32,8 @@ class SinglePageController extends Controller
{
return view('landing')->with([
'appSettings' => $this->settingService->all()->toJson(),
'lang' => $this->settingService->get('lang')
'lang' => App::currentLocale(),
'locales' => collect(config("2fauth.locales"))->toJson(),
]);
}
}