From 3dff8dfaf825d9e7fca8b22e4857a5061bf3179d Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 8 Aug 2019 17:08:36 +0200 Subject: [PATCH] Warning if you change your language. --- app/Http/Controllers/PreferencesController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index a9e58cf476..eddb76fb25 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; use FireflyIII\Models\AccountType; +use FireflyIII\Models\Preference; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Illuminate\Http\Request; @@ -134,10 +135,15 @@ class PreferencesController extends Controller } // language: + /** @var Preference $currentLang */ + $currentLang = app('preferences')->get('language', 'en_US'); $lang = $request->get('language'); if (array_key_exists($lang, config('firefly.languages'))) { app('preferences')->set('language', $lang); } + if ($currentLang->data !== $lang) { + session()->flash('info', 'All translations are supplied by volunteers. There might be errors and mistakes. I appreciate your feedback.'); + } // optional fields for transactions: $setOptions = $request->get('tj');