Issue 2695

Introduces localisation for API errors
This commit is contained in:
Dominic Guhl
2019-10-26 15:07:54 +02:00
parent 18310641aa
commit b4d565400e
32 changed files with 511 additions and 24 deletions

View File

@@ -79,10 +79,10 @@ class CurrencyExchangeRateController extends Controller
$toCurrency = $this->repository->findByCodeNull($request->get('to') ?? 'USD');
if (null === $fromCurrency) {
throw new FireflyException('Unknown source currency.');
throw new FireflyException(trans('api.error_unknown_source_currency'));
}
if (null === $toCurrency) {
throw new FireflyException('Unknown destination currency.');
throw new FireflyException(trans('api.error_unknown_destination_currency'));
}
/** @var Carbon $dateObj */