mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-02-02 12:17:22 +01:00
Added locale option to config
This commit is contained in:
parent
193fe84dcc
commit
1fbf124ebe
2
.env
2
.env
@ -1,3 +1,5 @@
|
||||
LOCALE=en
|
||||
|
||||
#Email verification=Changes if users have to verify their email after registration.
|
||||
#=REGISTER_AUTH either auth or verified. If auth is selected, no verification is required. Default is verified.
|
||||
REGISTER_AUTH=auth
|
||||
|
@ -290,6 +290,7 @@ return [
|
||||
'SMTP' => 'SMTP+',
|
||||
'Footer links' => 'Footer links+',
|
||||
'Debug' => 'Debug+',
|
||||
'Language' => 'Language+',
|
||||
|
||||
'default' => 'default+',
|
||||
'Apply' => 'Apply+',
|
||||
@ -458,6 +459,8 @@ return [
|
||||
'HOME_URL.description' => 'Set a user page as the home page. This will move the previous home page to example.com/home.+',
|
||||
'MAINTENANCE_MODE.title' => 'Enable Maintenance Mode+',
|
||||
'MAINTENANCE_MODE.description' => 'Displays a maintenance message on all public pages. This will disable the login pages.+',
|
||||
'LOCALE.title' => 'App locale+',
|
||||
'LOCALE.description' => 'Change the language of your application+',
|
||||
|
||||
|
||||
'' => '+',
|
||||
|
@ -414,8 +414,8 @@ document.getElementById("MAINTENANCE_MODE-form").addEventListener("change", func
|
||||
<div class="form-group col-lg-8">
|
||||
<input value="text" name="type" style="display:none;" type="text" class="form-control form-control-lg" required>
|
||||
<input value="HOME_FOOTER_LINK" name="entry" style="display:none;" type="text" class="form-control form-control-lg" required>
|
||||
<h5 style="margin-top:50px">@php foreach($configNames as $obj){if($obj->value == 'HOME_FOOTER_LINK'){echo $obj->title;}}; @endphp</h5>
|
||||
<p class="text-muted">@php foreach($configNames as $obj){if($obj->value == 'HOME_FOOTER_LINK'){echo $obj->description;}}; @endphp</p>
|
||||
<h5 style="margin-top:50px">@php echo __('messages.HOME_FOOTER_LINK.title'); @endphp</h5>
|
||||
<p class="text-muted">@php echo __('messages.HOME_FOOTER_LINK.description'); @endphp</p>
|
||||
<div class="input-group">
|
||||
<input type="url" style="border-radius:.25rem;max-width:600px" class="form-control" name="value" value="{{$configValue}}">
|
||||
<input type="hidden" name="_token" value="{{csrf_token()}}">
|
||||
@ -450,6 +450,47 @@ document.getElementById("MAINTENANCE_MODE-form").addEventListener("change", func
|
||||
</form>
|
||||
{{-- end debug settings --}}
|
||||
|
||||
{{-- start language --}}
|
||||
<a name="Language"><h2 class="ch2">{{__('messages.Language')}}</h2></a>
|
||||
<?php $configValue2 = str_replace('"', "", EnvEditor::getKey('LOCALE')); ?>
|
||||
<form id="language-form" action="{{route('editConfig')}}" enctype="multipart/form-data" method="post">
|
||||
<div class="form-group col-lg-8">
|
||||
<input value="homeurl" name="type" style="display:none;" type="text" class="form-control form-control-lg" required>
|
||||
<input value="LOCALE" name="entry" style="display:none;" type="text" class="form-control form-control-lg" required>
|
||||
<h5 style="margin-top:50px">{{__('messages.LOCALE.title')}}</h5>
|
||||
<p class="text-muted">{{__('messages.LOCALE.description')}}</p>
|
||||
<div class="input-group">
|
||||
<select style="max-width:600px" class="form-control" name="value">
|
||||
@if($configValue2 != '')
|
||||
<option>{{$configValue2}}</option>
|
||||
@endif
|
||||
<?php
|
||||
try {
|
||||
$langFolders = array_filter(glob(base_path('resources/lang') . '/*'), 'is_dir');
|
||||
} catch (\Exception $e) {
|
||||
$langFolders = [];
|
||||
}
|
||||
|
||||
foreach($langFolders as $folder) {
|
||||
$folderName = basename($folder);
|
||||
if ($folderName != $configValue2) {
|
||||
echo '<option>' . $folderName . '</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="_token" value="{{csrf_token()}}">
|
||||
<script type="text/javascript">
|
||||
document.getElementById("language-form").addEventListener("change", function() {
|
||||
this.submit();
|
||||
});
|
||||
</script>
|
||||
</form>
|
||||
{{-- end language --}}
|
||||
|
||||
|
||||
<br><br><br><br><br>
|
||||
|
||||
<script src="{{ asset('assets/external-dependencies/jquery-3.4.1.min.js') }}"></script>
|
||||
|
@ -57,6 +57,9 @@ use App\Models\Page;
|
||||
if(EnvEditor::keyExists('DISPLAY_CREDIT_FOOTER')){ /* Do nothing if key already exists */
|
||||
} else {EnvEditor::addKey('DISPLAY_CREDIT_FOOTER', 'true');}
|
||||
|
||||
if(EnvEditor::keyExists('LOCALE')){ /* Do nothing if key already exists */
|
||||
} else {EnvEditor::addKey('LOCALE', 'en');}
|
||||
|
||||
if(EnvEditor::keyExists('ADMIN_EMAIL')){} else
|
||||
{if(Auth::user()->id == 1){EnvEditor::addKey('ADMIN_EMAIL', App\Models\User::find(1)->email);}
|
||||
else{EnvEditor::addKey('ADMIN_EMAIL', '');}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user