diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index a44b50c7..8fc891b7 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -15,17 +15,4 @@ class HomeController extends Controller return view('index')->with('user', $users->getCurrentUser()); } - public function locale($lang, Request $request) - { - if (Arr::exists(config('locales'), $lang)) { - Session::set('locale', $lang); - } - - if (isset($_SERVER['HTTP_REFERER'])) { - return redirect('/')->setTargetUrl($_SERVER['HTTP_REFERER'])->withCookie('locale', $lang); - } else { - return redirect('/')->withCookie('locale', $lang); - } - } - } diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index 3a11abb8..d9ed7662 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -16,15 +16,6 @@ use App\Exceptions\PrettyPageException; class SetupController extends Controller { - public function __construct(Request $request) - { - if ($locale = $request->input('lang')) { - cookie()->queue('locale', $locale); - session(['locale' => $locale]); - app()->setLocale($locale); - } - } - public function welcome() { // already installed diff --git a/config/datatables.php b/config/datatables.php index f5cc2b3b..05522831 100644 --- a/config/datatables.php +++ b/config/datatables.php @@ -39,60 +39,8 @@ return [ 'serializer' => 'League\Fractal\Serializer\DataArraySerializer', ], - /** - * DataTables script view template. - */ - 'script_template' => 'datatables::script', - /** * DataTables internal index id response column name. */ 'index_column' => 'DT_Row_Index', - - /** - * Namespaces used by the generator. - */ - 'namespace' => [ - /** - * Base namespace/directory to create the new file. - * This is appended on default Laravel namespace. - * Usage: php artisan datatables:make User - * Output: App\DataTables\UserDataTable - * With Model: App\User (default model) - * Export filename: users_timestamp - */ - 'base' => 'DataTables', - - /** - * Base namespace/directory where your model's are located. - * This is appended on default Laravel namespace. - * Usage: php artisan datatables:make Post --model - * Output: App\DataTables\PostDataTable - * With Model: App\Post - * Export filename: posts_timestamp - */ - 'model' => '', - ], - - /** - * PDF generator to be used when converting the table to pdf. - * Available generators: excel, snappy - * Snappy package: barryvdh/laravel-snappy - * Excel package: maatwebsite/excel - */ - 'pdf_generator' => 'excel', - - /** - * Snappy PDF options. - */ - 'snappy' => [ - 'options' => [ - 'no-outline' => true, - 'margin-left' => '0', - 'margin-right' => '0', - 'margin-top' => '10mm', - 'margin-bottom' => '10mm', - ], - 'orientation' => 'landscape', - ], ]; diff --git a/resources/lang/en/errors.yml b/resources/lang/en/errors.yml index a435a760..b48c0d46 100644 --- a/resources/lang/en/errors.yml +++ b/resources/lang/en/errors.yml @@ -7,5 +7,7 @@ general: title: Error occurred exception: + code: 'Error code: :code' + detail: 'Details: :msg' message: | Whoops, looks like something went wrong. (enable APP_DEBUG in .env to see details) diff --git a/resources/lang/zh_CN/errors.yml b/resources/lang/zh_CN/errors.yml index 31db5b5c..96e97cfe 100644 --- a/resources/lang/zh_CN/errors.yml +++ b/resources/lang/zh_CN/errors.yml @@ -7,6 +7,8 @@ general: title: 出现错误 exception: + code: 'Error code: :code' + detail: 错误码::code message: | 如果您是访客,这说明网站程序出现了一些错误,请您稍后再试或联系站长。 如果您是站长,请开启 .env 中的 APP_DEBUG 以查看详细信息。 diff --git a/resources/views/errors/403.tpl b/resources/views/errors/403.tpl index eb83b47a..ec95becb 100644 --- a/resources/views/errors/403.tpl +++ b/resources/views/errors/403.tpl @@ -7,5 +7,5 @@ @include('setup.wizard.language') -

{{ trans('errors.exception.message', ['msg' => $exception->getMessage() ?: trans('errors.http.msg-403')]) }}

+

{{ trans('errors.exception.detail', ['msg' => $exception->getMessage() ?: trans('errors.http.msg-403')]) }}

@endsection diff --git a/resources/views/errors/404.tpl b/resources/views/errors/404.tpl index d9544524..61ff5813 100644 --- a/resources/views/errors/404.tpl +++ b/resources/views/errors/404.tpl @@ -7,5 +7,5 @@ @include('setup.wizard.language') -

{{ trans('errors.exception.message', ['msg' => $exception->getMessage() ?: trans('errors.http.msg-404')]) }}

+

{{ trans('errors.exception.detail', ['msg' => $exception->getMessage() ?: trans('errors.http.msg-404')]) }}

@endsection diff --git a/resources/views/errors/503.tpl b/resources/views/errors/503.tpl index 143c4c8d..82fdb499 100644 --- a/resources/views/errors/503.tpl +++ b/resources/views/errors/503.tpl @@ -7,5 +7,5 @@ @include('setup.wizard.language') -

{{ trans('errors.exception.message', ['msg' => $exception->getMessage() ?: trans('errors.http.msg-503')]) }}

+

{{ trans('errors.exception.detail', ['msg' => $exception->getMessage() ?: trans('errors.http.msg-503')]) }}

@endsection diff --git a/resources/views/errors/pretty.tpl b/resources/views/errors/pretty.tpl index 6df382fd..567947fc 100644 --- a/resources/views/errors/pretty.tpl +++ b/resources/views/errors/pretty.tpl @@ -8,5 +8,5 @@

{{ trans('errors.exception.code', ['code' => $code]) }}

-

{!! trans('errors.exception.message', ['msg' => $message]) !!}

+

{!! trans('errors.exception.detail', ['msg' => $message]) !!}

@endsection diff --git a/resources/views/vendor/language.tpl b/resources/views/vendor/language.tpl index 0861e4a7..e595e51a 100644 --- a/resources/views/vendor/language.tpl +++ b/resources/views/vendor/language.tpl @@ -7,7 +7,7 @@