Add locale to variables.

This commit is contained in:
James Cole 2020-07-27 20:06:18 +02:00
parent d49743031f
commit 1c07feb446
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D

View File

@ -136,7 +136,7 @@ class JavascriptController extends Controller
if(null !== $account) {
$currency = $repository->getAccountCurrency($account) ?? $currency;
}
$locale = app('steam')->getLocale();
$accounting = app('amount')->getJsConfig();
$accounting['frac_digits'] = $currency->decimal_places;
$pref = app('preferences')->get('language', config('firefly.default_language', 'en_US'));
@ -146,13 +146,14 @@ class JavascriptController extends Controller
$uid = substr(hash('sha256', sprintf('%s-%s-%s', (string) config('app.key'), auth()->user()->id, auth()->user()->email)), 0, 12);
$data = [
'currencyCode' => $currency->code,
'currencySymbol' => $currency->symbol,
'accountingLocaleInfo' => $accounting,
'language' => $lang,
'dateRangeTitle' => $dateRange['title'],
'dateRangeConfig' => $dateRange['configuration'],
'uid' => $uid,
'currencyCode' => $currency->code,
'currencySymbol' => $currency->symbol,
'accountingLocaleInfo' => $accounting,
'language' => $lang,
'dateRangeTitle' => $dateRange['title'],
'locale' => $locale,
'dateRangeConfig' => $dateRange['configuration'],
'uid' => $uid,
];
$request->session()->keep(['two-factor-secret']);