mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-30 20:54:04 -06:00
Edit and set language [skip ci]
This commit is contained in:
parent
392c1fc399
commit
9f99e7c0af
@ -1,5 +1,6 @@
|
|||||||
<?php namespace FireflyIII\Http\Controllers;
|
<?php namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
|
use Config;
|
||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
use Input;
|
use Input;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
@ -37,9 +38,11 @@ class PreferencesController extends Controller
|
|||||||
$viewRange = $viewRangePref->data;
|
$viewRange = $viewRangePref->data;
|
||||||
$frontPageAccounts = Preferences::get('frontPageAccounts', []);
|
$frontPageAccounts = Preferences::get('frontPageAccounts', []);
|
||||||
$budgetMax = Preferences::get('budgetMaximum', 1000);
|
$budgetMax = Preferences::get('budgetMaximum', 1000);
|
||||||
|
$languagePref = Preferences::get('language', 'en');
|
||||||
|
$language = $languagePref->data;
|
||||||
$budgetMaximum = $budgetMax->data;
|
$budgetMaximum = $budgetMax->data;
|
||||||
|
|
||||||
return view('preferences.index', compact('budgetMaximum', 'accounts', 'frontPageAccounts', 'viewRange'));
|
return view('preferences.index', compact('budgetMaximum', 'language', 'accounts', 'frontPageAccounts', 'viewRange'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -65,6 +68,12 @@ class PreferencesController extends Controller
|
|||||||
$budgetMaximum = intval(Input::get('budgetMaximum'));
|
$budgetMaximum = intval(Input::get('budgetMaximum'));
|
||||||
Preferences::set('budgetMaximum', $budgetMaximum);
|
Preferences::set('budgetMaximum', $budgetMaximum);
|
||||||
|
|
||||||
|
// language:
|
||||||
|
$lang = Input::get('language');
|
||||||
|
if (in_array($lang, array_keys(Config::get('firefly.lang')))) {
|
||||||
|
Preferences::set('language', $lang);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Session::flash('success', 'Preferences saved!');
|
Session::flash('success', 'Preferences saved!');
|
||||||
|
|
||||||
|
@ -95,7 +95,11 @@
|
|||||||
{% for key, lang in Config.get('firefly.lang') %}
|
{% for key, lang in Config.get('firefly.lang') %}
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="language" value="{{ key }}" />
|
<input type="radio" name="language" value="{{ key }}"
|
||||||
|
{% if language == key %}
|
||||||
|
checked
|
||||||
|
{% endif %}
|
||||||
|
/>
|
||||||
{{ lang }}
|
{{ lang }}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user