Allow configuring of automatic localization. Closes #1747

This commit is contained in:
James Brooks
2016-05-05 10:41:42 +01:00
parent 9ddf9e3e1a
commit 47e1dff5c5
4 changed files with 19 additions and 1 deletions
+2 -1
View File
@@ -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');
+5
View File
@@ -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');