Add sort to language.

This commit is contained in:
James Cole 2020-03-16 06:54:18 +01:00
parent a478d1b544
commit 4334928fbd
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 4 additions and 2 deletions

View File

@ -86,13 +86,14 @@ class PreferencesController extends Controller
$viewRange = $viewRangePref->data;
$frontPageAccounts = app('preferences')->get('frontPageAccounts', $accountIds);
$language = app('preferences')->get('language', config('firefly.default_language', 'en_US'))->data;
$languages = config('firefly.languages');
$listPageSize = app('preferences')->get('listPageSize', 50)->data;
$customFiscalYear = app('preferences')->get('customFiscalYear', 0)->data;
$fiscalYearStartStr = app('preferences')->get('fiscalYearStart', '01-01')->data;
$fiscalYearStart = date('Y') . '-' . $fiscalYearStartStr;
$tjOptionalFields = app('preferences')->get('transaction_journal_optional_fields', [])->data;
ksort($language);
ksort($languages);
// an important fallback is that the frontPageAccount array gets refilled automatically
// when it turns up empty.
@ -106,6 +107,7 @@ class PreferencesController extends Controller
'language',
'groupedAccounts',
'frontPageAccounts',
'languages',
'tjOptionalFields',
'viewRange',
'customFiscalYear',

View File

@ -30,7 +30,7 @@
<div class="form-group">
<div class="col-sm-12">
<select class="form-control" id="lang_holder" name="language">
{% for key, lang in Config.get('firefly.languages') %}
{% for key, lang in languages %}
<option {% if language == key %}
selected
{% endif %} value="{{ key }}">{{ lang.name_locale }} ({{ lang.name_english }})</option>