diff --git a/app/Http/Requests/StoreSettingsRequest.php b/app/Http/Requests/StoreSettingsRequest.php index b4f4dbb..9b24066 100644 --- a/app/Http/Requests/StoreSettingsRequest.php +++ b/app/Http/Requests/StoreSettingsRequest.php @@ -19,6 +19,10 @@ class StoreSettingsRequest extends FormRequest 'min:2', 'max:100', ], + 'locale' => [ + 'required', + 'in:fr,en', + ], 'is_private' => [ 'nullable', 'in:on,off', diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index e7f014d..ba1d6f6 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -23,6 +23,8 @@ class AppServiceProvider extends ServiceProvider public function boot() { + $this->app->setLocale(app('shaarli')->getLocale()); + View::composer('layouts.partials.scripts', function (\Illuminate\View\View $view) { $locale = config('app.locale'); diff --git a/config/shaarli.php b/config/shaarli.php index 4e33737..f5b9c65 100644 --- a/config/shaarli.php +++ b/config/shaarli.php @@ -2,6 +2,7 @@ return [ 'name' => env('APP_NAME'), + 'locale' => env('APP_LOCALE'), 'is_private' => false, 'is_dark' => false, ]; diff --git a/readme.md b/readme.md index 55737df..92e1090 100644 --- a/readme.md +++ b/readme.md @@ -25,6 +25,7 @@ but built with [Laravel](https://github.com/laravel/laravel) and [Vue.js](https: - [x] Original Shaarli import - [x] RSS feed - [x] Export +- [x] Dark mode - [x] i18n (english and french) ## Screenshots diff --git a/storage/settings.json b/storage/settings.json deleted file mode 100644 index 66063a8..0000000 --- a/storage/settings.json +++ /dev/null @@ -1 +0,0 @@ -{"is_private":false,"name":"Shaarli","is_dark":false} \ No newline at end of file