mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 12:28:46 +00:00
Replaced some language calls.
This commit is contained in:
@@ -36,8 +36,8 @@ abstract class Controller extends BaseController
|
||||
if (Auth::check()) {
|
||||
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'));
|
||||
$lang = $pref->data;
|
||||
$this->monthFormat = Config::get('firefly.month.' . $lang);
|
||||
$this->monthAndDayFormat = Config::get('firefly.monthAndDay.' . $lang);
|
||||
$this->monthFormat = trans('config.month');
|
||||
$this->monthAndDayFormat = trans('config.month_and_day');
|
||||
|
||||
View::share('monthFormat', $this->monthFormat);
|
||||
View::share('monthAndDayFormat', $this->monthAndDayFormat);
|
||||
|
||||
@@ -37,10 +37,12 @@ class PreferencesController extends Controller
|
||||
$viewRange = $viewRangePref->data;
|
||||
$frontPageAccounts = Preferences::get('frontPageAccounts', []);
|
||||
$budgetMax = Preferences::get('budgetMaximum', 1000);
|
||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data;
|
||||
$budgetMaximum = $budgetMax->data;
|
||||
|
||||
return view('preferences.index', compact('budgetMaximum', 'language', 'accounts', 'frontPageAccounts', 'viewRange'));
|
||||
$showIncomplete = env('SHOW_INCOMPLETE_TRANSLATIONS', 'false') == 'true';
|
||||
|
||||
return view('preferences.index', compact('budgetMaximum', 'language', 'accounts', 'frontPageAccounts', 'viewRange', 'showIncomplete'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,7 +72,7 @@ class PreferencesController extends Controller
|
||||
|
||||
// language:
|
||||
$lang = Input::get('language');
|
||||
if (in_array($lang, array_keys(Config::get('firefly.lang')))) {
|
||||
if (in_array($lang, array_keys(Config::get('firefly.languages')))) {
|
||||
Preferences::set('language', $lang);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,9 +64,11 @@ class Authenticate
|
||||
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'));
|
||||
App::setLocale($pref->data);
|
||||
Carbon::setLocale(substr($pref->data,0,2));
|
||||
$locale = explode(',', trans('config.locale'));
|
||||
$locale = array_map('trim', $locale);
|
||||
|
||||
setlocale(LC_TIME, Config::get('firefly.locales.' . $pref->data));
|
||||
setlocale(LC_MONETARY, Config::get('firefly.locales.' . $pref->data));
|
||||
setlocale(LC_TIME, $locale);
|
||||
setlocale(LC_MONETARY, $locale);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
@@ -354,8 +354,7 @@ Breadcrumbs::register(
|
||||
'reports.report', function (Generator $breadcrumbs, Carbon $start, Carbon $end, $reportType, $accountIds) {
|
||||
$breadcrumbs->parent('reports.index');
|
||||
|
||||
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
||||
$monthFormat = Config::get('firefly.monthAndDay.' . $pref);
|
||||
$monthFormat = trans('config.month_and_day');
|
||||
$title = trans('firefly.report_default', ['start' => $start->formatLocalized($monthFormat), 'end' => $end->formatLocalized($monthFormat)]);
|
||||
|
||||
$breadcrumbs->push($title, route('reports.report', ['url' => 'abcde']));
|
||||
|
||||
Reference in New Issue
Block a user