Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Rename languages.
James Colec1ba591b2699
diff --git a/.env.example b/.env.exampleindex 25a959d3bb..9a4ad1ba45 100644--- a/.env.example+++ b/.env.example@@ -12,6 +12,7 @@ CACHE_DRIVER=fileSESSION_DRIVER=fileDEFAULT_CURRENCY=EUR+DEFAULT_LANGUAGE=en_USEMAIL_SMTP=EMAIL_DRIVER=smtpdiff --git a/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php b/app/Generator/Chart/Account/ChartJsAccountChartGenerator.phpindex ec8460cdfd..280c0a2bdc 100644--- a/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php+++ b/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php@@ -105,7 +105,7 @@ class ChartJsAccountChartGenerator implements AccountChartGeneratorpublic function frontpage(Collection $accounts, Carbon $start, Carbon $end){// language:- $language = Preferences::get('language', 'en')->data;+ $language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;$format = Config::get('firefly.monthAndDay.' . $language);$data = ['count' => 0,@@ -151,7 +151,7 @@ class ChartJsAccountChartGenerator implements AccountChartGeneratorpublic function single(Account $account, Carbon $start, Carbon $end){// language:- $language = Preferences::get('language', 'en')->data;+ $language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;$format = Config::get('firefly.monthAndDay.' . $language);$data = [diff --git a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.phpindex 8a63f803aa..972944763f 100644--- a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php+++ b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php@@ -71,7 +71,7 @@ class ChartJsBillChartGenerator implements BillChartGeneratorpublic function single(Bill $bill, Collection $entries){// language:- $language = Preferences::get('language', 'en')->data;+ $language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;$format = Config::get('firefly.month.' . $language);$data = [diff --git a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.phpindex 9bc1d28877..d0952216c9 100644--- a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php+++ b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php@@ -24,7 +24,7 @@ class ChartJsBudgetChartGenerator implements BudgetChartGeneratorpublic function budget(Collection $entries, $dateFormat = 'month'){// language:- $language = Preferences::get('language', 'en')->data;+ $language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;$format = Config::get('firefly.' . $dateFormat . '.' . $language);$data = [@@ -115,7 +115,7 @@ class ChartJsBudgetChartGenerator implements BudgetChartGeneratorpublic function year(Collection $budgets, Collection $entries){// language:- $language = Preferences::get('language', 'en')->data;+ $language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;$format = Config::get('firefly.month.' . $language);$data = [diff --git a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.phpindex 07eb4e0f31..cac74e488e 100644--- a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php+++ b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php@@ -101,7 +101,7 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator{// language:- $language = Preferences::get('language', 'en')->data;+ $language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;$format = Config::get('firefly.month.' . $language);$data = [@@ -135,7 +135,7 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator{// language:- $language = Preferences::get('language', 'en')->data;+ $language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;$format = Config::get('firefly.month.' . $language);$data = [diff --git a/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php b/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.phpindex 8927d1bb91..e1aa9fb352 100644--- a/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php+++ b/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php@@ -25,7 +25,7 @@ class ChartJsPiggyBankChartGenerator implements PiggyBankChartGenerator{// language:- $language = Preferences::get('language', 'en')->data;+ $language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;$format = Config::get('firefly.monthAndDay.' . $language);$data = [diff --git a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php b/app/Generator/Chart/Report/ChartJsReportChartGenerator.phpindex 0b2250b39a..8cd93f3ccf 100644--- a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php+++ b/app/Generator/Chart/Report/ChartJsReportChartGenerator.php@@ -22,7 +22,7 @@ class ChartJsReportChartGenerator implements ReportChartGeneratorpublic function yearInOut(Collection $entries){// language:- $language = Preferences::get('language', 'en')->data;+ $language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;$format = Config::get('firefly.month.' . $language);$data = [diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.phpindex 03a9a8d31c..d733973e30 100644--- a/app/Http/Controllers/Controller.php+++ b/app/Http/Controllers/Controller.php@@ -34,7 +34,7 @@ abstract class Controller extends BaseControllerView::share('hideTags', false);if (Auth::check()) {- $pref = Preferences::get('language', 'en');+ $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);diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.phpindex 8bfd176f53..9fd0cb95b9 100644--- a/app/Http/Controllers/PreferencesController.php+++ b/app/Http/Controllers/PreferencesController.php@@ -37,7 +37,7 @@ class PreferencesController extends Controller$viewRange = $viewRangePref->data;$frontPageAccounts = Preferences::get('frontPageAccounts', []);$budgetMax = Preferences::get('budgetMaximum', 1000);- $language = Preferences::get('language', 'en')->data;+ $language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;$budgetMaximum = $budgetMax->data;return view('preferences.index', compact('budgetMaximum', 'language', 'accounts', 'frontPageAccounts', 'viewRange'));diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.phpindex 458e19f62d..0205f06ba6 100644--- a/app/Http/Middleware/Authenticate.php+++ b/app/Http/Middleware/Authenticate.php@@ -61,7 +61,7 @@ class Authenticate}// if logged in, set user language:- $pref = Preferences::get('language', 'en');+ $pref = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'));App::setLocale($pref->data);Carbon::setLocale($pref->data);diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.phpindex 3494c7a1f7..6030da8875 100644--- a/app/Http/breadcrumbs.php+++ b/app/Http/breadcrumbs.php@@ -354,7 +354,7 @@ Breadcrumbs::register('reports.report', function (Generator $breadcrumbs, Carbon $start, Carbon $end, $reportType, $accountIds) {$breadcrumbs->parent('reports.index');- $pref = Preferences::get('language', 'en')->data;+ $pref = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;$monthFormat = Config::get('firefly.monthAndDay.' . $pref);$title = trans('firefly.report_default', ['start' => $start->formatLocalized($monthFormat), 'end' => $end->formatLocalized($monthFormat)]);diff --git a/config/app.php b/config/app.phpindex 93cef6cb6f..ced4a3e0b6 100644--- a/config/app.php+++ b/config/app.php@@ -52,7 +52,7 @@ return [|*/- 'locale' => 'en',+ 'locale' => 'en_US',/*|--------------------------------------------------------------------------@@ -65,7 +65,7 @@ return [|*/- 'fallback_locale' => 'en',+ 'fallback_locale' => 'en_US',/*|--------------------------------------------------------------------------diff --git a/config/firefly.php b/config/firefly.phpindex 0bab3ab71a..ced04e09a9 100644--- a/config/firefly.php+++ b/config/firefly.php@@ -99,12 +99,12 @@ return ['Cash account' => 'cash',],'lang' => [- 'en' => 'English',- 'nl' => 'Nederlands'+ 'en_US' => 'English',+ 'nl_NL' => 'Nederlands'],'locales' => [- 'en' => ['en', 'English', 'en_US', 'en_US.utf8'],- 'nl' => ['nl', 'Dutch', 'nl_NL', 'nl_NL.utf8'],+ 'en_US' => ['en', 'English', 'en_US', 'en_US.utf8'],+ 'nl_NL' => ['nl', 'Dutch', 'nl_NL', 'nl_NL.utf8'],],'transactionTypesByWhat' => ['expenses' => ['Withdrawal'],@@ -125,12 +125,12 @@ return [],'month' => [- 'en' => '%B %Y',- 'nl' => '%B %Y',+ 'en_US' => '%B %Y',+ 'nl_NL' => '%B %Y',],'monthAndDay' => [- 'en' => '%B %e, %Y',- 'nl' => '%e %B %Y',+ 'en_US' => '%B %e, %Y',+ 'nl_NL' => '%e %B %Y',],];