Skip to content

Commit

Permalink
Fix issues with localizations not applying properly
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed May 26, 2016
1 parent 48c4240 commit 2b87629
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Foundation/Providers/ConfigServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function boot()
$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);
}
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Middleware/Localize.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public function __construct(Repository $config)
*/
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);
}

Expand Down
14 changes: 13 additions & 1 deletion config/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,24 @@

/*
|--------------------------------------------------------------------------
| Enable subscribers.
| Enable subscribers
|--------------------------------------------------------------------------
|
| Whether to allow people to subscribe to the status page.
|
*/

'enable_subscribers' => true,

/*
|--------------------------------------------------------------------------
| Automatic Localization
|--------------------------------------------------------------------------
|
| Whether to automatically localize the status to the visitors default
| browser language settings.
|
*/

'automatic_localization' => false,
];

0 comments on commit 2b87629

Please sign in to comment.