Skip to content

Firefly III: a personal finances manager

Fix #11132

James Cole40c4c9f1098f
diff --git a/app/Http/Controllers/Account/CreateController.php b/app/Http/Controllers/Account/CreateController.php
index bab54065d9..81ab82b9c8 100644
--- a/app/Http/Controllers/Account/CreateController.php
+++ b/app/Http/Controllers/Account/CreateController.php
@@ -96,11 +96,10 @@ class CreateController extends Controller
];
// interest calculation periods:
- $interestPeriods = [
- 'daily' => (string) trans('firefly.interest_calc_daily'),
- 'monthly' => (string) trans('firefly.interest_calc_monthly'),
- 'yearly' => (string) trans('firefly.interest_calc_yearly'),
- ];
+ $interestPeriods = [];
+ foreach(config('firefly.interest_periods') as $period) {
+ $interestPeriods[$period] = trans(sprintf('firefly.interest_calc_%s' , $period));
+ }
// pre fill some data
$request->session()->flash(
diff --git a/app/Http/Controllers/Account/EditController.php b/app/Http/Controllers/Account/EditController.php
index 8c2d083b13..06ae515db4 100644
--- a/app/Http/Controllers/Account/EditController.php
+++ b/app/Http/Controllers/Account/EditController.php
@@ -108,11 +108,10 @@ class EditController extends Controller
];
// interest calculation periods:
- $interestPeriods = [
- 'daily' => (string) trans('firefly.interest_calc_daily'),
- 'monthly' => (string) trans('firefly.interest_calc_monthly'),
- 'yearly' => (string) trans('firefly.interest_calc_yearly'),
- ];
+ $interestPeriods = [];
+ foreach(config('firefly.interest_periods') as $period) {
+ $interestPeriods[$period] = trans(sprintf('firefly.interest_calc_%s' , $period));
+ }
// put previous url in session if not redirect from store (not "return_to_edit").
if (true !== session('accounts.edit.fromUpdate')) {
diff --git a/config/firefly.php b/config/firefly.php
index 6bbb6b2429..ea0f90e122 100644
--- a/config/firefly.php
+++ b/config/firefly.php
@@ -309,7 +309,7 @@ return [
// "period must be in this list" values
'bill_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
- 'interest_periods' => ['weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
+ 'interest_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
// settings to translate X to Y
'range_to_repeat_freq' => [