diff --git a/app/Composers/AppComposer.php b/app/Composers/AppComposer.php index 9ea5bbda..2eb6e429 100644 --- a/app/Composers/AppComposer.php +++ b/app/Composers/AppComposer.php @@ -42,8 +42,9 @@ class AppComposer $view->withAppHeader(Config::get('setting.header')); $view->withAppFooter(Config::get('setting.footer')); - $view->withAppName($name = Config::get('setting.app_name')); + $view->withAppName(Config::get('setting.app_name')); $view->withShowSupport($support = Config::get('setting.show_support')); + $view->withAutomaticLocalization(Config::get('setting.automatic_localization')); if ($support) { $view->withSiteTitle(Config::get('setting.app_name').' | Cachet'); diff --git a/app/Http/Middleware/Localize.php b/app/Http/Middleware/Localize.php index 552b3b07..5481ace1 100644 --- a/app/Http/Middleware/Localize.php +++ b/app/Http/Middleware/Localize.php @@ -55,6 +55,11 @@ class Localize */ public function handle(Request $request, Closure $next) { + // Early exit optimization. + if (!$this->config->get('setting.automatic_localization')) { + return $next($request); + } + $supportedLanguages = $request->getLanguages(); $userLanguage = $this->config->get('app.locale'); diff --git a/resources/lang/en/forms.php b/resources/lang/en/forms.php index 4d024597..9a373e03 100755 --- a/resources/lang/en/forms.php +++ b/resources/lang/en/forms.php @@ -108,6 +108,7 @@ return [ 'banner' => 'Banner Image', 'banner-help' => "It's recommended that you upload files no bigger than 930px wide .", 'subscribers' => 'Allow people to signup to email notifications?', + 'automatic_localization' => 'Automatically localise your status page to your visitor\'s language?', ], 'analytics' => [ 'analytics_google' => 'Google Analytics code', diff --git a/resources/views/dashboard/settings/app-setup.blade.php b/resources/views/dashboard/settings/app-setup.blade.php index a301f520..cd004fb1 100644 --- a/resources/views/dashboard/settings/app-setup.blade.php +++ b/resources/views/dashboard/settings/app-setup.blade.php @@ -84,6 +84,17 @@ +
+
+
+ +
+
+