From 2b87629dca796768e9e904a68c3c7b543b05f396 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Thu, 26 May 2016 11:35:00 +0100 Subject: [PATCH] Fix issues with localizations not applying properly --- app/Foundation/Providers/ConfigServiceProvider.php | 2 +- app/Http/Middleware/Localize.php | 3 +-- config/setting.php | 14 +++++++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/Foundation/Providers/ConfigServiceProvider.php b/app/Foundation/Providers/ConfigServiceProvider.php index 626dea93..583926de 100644 --- a/app/Foundation/Providers/ConfigServiceProvider.php +++ b/app/Foundation/Providers/ConfigServiceProvider.php @@ -61,7 +61,7 @@ class ConfigServiceProvider extends ServiceProvider $this->app->config->set('app.url', $appDomain); } - if ($appLocale = $this->app->config->get('setting.app.locale')) { + if ($appLocale = $this->app->config->get('setting.app_locale')) { $this->app->config->set('app.locale', $appLocale); $this->app->translator->setLocale($appLocale); } diff --git a/app/Http/Middleware/Localize.php b/app/Http/Middleware/Localize.php index 5481ace1..718e2ddb 100644 --- a/app/Http/Middleware/Localize.php +++ b/app/Http/Middleware/Localize.php @@ -55,8 +55,7 @@ class Localize */ public function handle(Request $request, Closure $next) { - // Early exit optimization. - if (!$this->config->get('setting.automatic_localization')) { + if (!(bool) $this->config->get('setting.automatic_localization')) { return $next($request); } diff --git a/config/setting.php b/config/setting.php index 86e9c345..d96835fb 100644 --- a/config/setting.php +++ b/config/setting.php @@ -23,7 +23,7 @@ return [ /* |-------------------------------------------------------------------------- - | Enable subscribers. + | Enable subscribers |-------------------------------------------------------------------------- | | Whether to allow people to subscribe to the status page. @@ -31,4 +31,16 @@ return [ */ 'enable_subscribers' => true, + + /* + |-------------------------------------------------------------------------- + | Automatic Localization + |-------------------------------------------------------------------------- + | + | Whether to automatically localize the status to the visitors default + | browser language settings. + | + */ + + 'automatic_localization' => false, ];