Allow configuring of automatic localization. Closes #1747
This commit is contained in:
@@ -42,8 +42,9 @@ class AppComposer
|
|||||||
$view->withAppHeader(Config::get('setting.header'));
|
$view->withAppHeader(Config::get('setting.header'));
|
||||||
$view->withAppFooter(Config::get('setting.footer'));
|
$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->withShowSupport($support = Config::get('setting.show_support'));
|
||||||
|
$view->withAutomaticLocalization(Config::get('setting.automatic_localization'));
|
||||||
|
|
||||||
if ($support) {
|
if ($support) {
|
||||||
$view->withSiteTitle(Config::get('setting.app_name').' | Cachet');
|
$view->withSiteTitle(Config::get('setting.app_name').' | Cachet');
|
||||||
|
|||||||
@@ -55,6 +55,11 @@ class Localize
|
|||||||
*/
|
*/
|
||||||
public function handle(Request $request, Closure $next)
|
public function handle(Request $request, Closure $next)
|
||||||
{
|
{
|
||||||
|
// Early exit optimization.
|
||||||
|
if (!$this->config->get('setting.automatic_localization')) {
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
|
||||||
$supportedLanguages = $request->getLanguages();
|
$supportedLanguages = $request->getLanguages();
|
||||||
$userLanguage = $this->config->get('app.locale');
|
$userLanguage = $this->config->get('app.locale');
|
||||||
|
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ return [
|
|||||||
'banner' => 'Banner Image',
|
'banner' => 'Banner Image',
|
||||||
'banner-help' => "It's recommended that you upload files no bigger than 930px wide .",
|
'banner-help' => "It's recommended that you upload files no bigger than 930px wide .",
|
||||||
'subscribers' => 'Allow people to signup to email notifications?',
|
'subscribers' => 'Allow people to signup to email notifications?',
|
||||||
|
'automatic_localization' => 'Automatically localise your status page to your visitor\'s language?',
|
||||||
],
|
],
|
||||||
'analytics' => [
|
'analytics' => [
|
||||||
'analytics_google' => 'Google Analytics code',
|
'analytics_google' => 'Google Analytics code',
|
||||||
|
|||||||
@@ -84,6 +84,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input type="hidden" value="0" name="automatic_localization">
|
||||||
|
<input type="checkbox" value="1" name="automatic_localization" {{ $automatic_localization ? 'checked' : null }}>
|
||||||
|
{{ trans('forms.settings.app-setup.automatic_localization') }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
Reference in New Issue
Block a user