fix language setting only available in view (#1117)

This commit is contained in:
jatdung
2023-02-24 01:24:11 +08:00
committed by GitHub
parent cd4b522935
commit cefe07d218

View File

@@ -43,6 +43,9 @@ class AppServiceProvider extends ServiceProvider
ProcessApps::dispatch();
}
$lang = Setting::fetch('language');
\App::setLocale($lang);
// User specific settings need to go here as session isn't available at this point in the app
view()->composer('*', function ($view) {
if (isset($_SERVER['HTTP_AUTHORIZATION']) && ! empty($_SERVER['HTTP_AUTHORIZATION'])) {
@@ -77,9 +80,6 @@ class AppServiceProvider extends ServiceProvider
$allusers = User::all();
$current_user = User::currentUser();
$lang = Setting::fetch('language');
\App::setLocale($lang);
$view->with('alt_bg', $alt_bg);
$view->with('allusers', $allusers);
$view->with('current_user', $current_user);