Add support for British English and allow the user to set a locale.

This commit is contained in:
James Cole
2020-04-19 06:51:40 +02:00
parent aa786eaaf3
commit c398aa2b69
17 changed files with 78 additions and 42 deletions

View File

@@ -61,6 +61,7 @@ trait ChartGeneration
return $cache->get(); // @codeCoverageIgnore
}
Log::debug('Regenerate chart.account.account-balance-chart from scratch.');
$locale = app('steam')->getLocale();
/** @var GeneratorInterface $generator */
$generator = app(GeneratorInterface::class);
@@ -89,7 +90,7 @@ trait ChartGeneration
$previous = array_values($range)[0];
while ($currentStart <= $end) {
$format = $currentStart->format('Y-m-d');
$label = $currentStart->formatLocalized((string)trans('config.month_and_day'));
$label = $currentStart->formatLocalized((string)trans('config.month_and_day', [], $locale));
$balance = isset($range[$format]) ? round($range[$format], 12) : $previous;
$previous = $balance;
$currentStart->addDay();