Warning if you change your language.

This commit is contained in:
James Cole 2019-08-08 17:08:36 +02:00
parent 53c7c6685b
commit 3dff8dfaf8
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -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');