Skip to content

Firefly III: a personal finances manager

Some forgotten translations.

James Cole664fde234416
diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php
index d2bdbf7e06..c7422c7195 100644
--- a/app/Http/Controllers/CurrencyController.php
+++ b/app/Http/Controllers/CurrencyController.php
@@ -60,7 +60,7 @@ class CurrencyController extends Controller
Preferences::set('currencyPreference', $currency->code);
Preferences::mark();
- Session::flash('success', $currency->name . ' is now the default currency.');
+ Session::flash('success', trans('firefly.new_default_currency', ['name' => $currency->name]));
Cache::forget('FFCURRENCYSYMBOL');
Cache::forget('FFCURRENCYCODE');
@@ -78,7 +78,7 @@ class CurrencyController extends Controller
{
if ($repository->countJournals($currency) > 0) {
- Session::flash('error', 'Cannot delete ' . e($currency->name) . ' because there are still transactions attached to it.');
+ Session::flash('error', trans('firefly.cannot_delete_currency', ['name' => $currency->name]));
return redirect(route('currency.index'));
}
@@ -103,12 +103,12 @@ class CurrencyController extends Controller
public function destroy(CurrencyRepositoryInterface $repository, TransactionCurrency $currency)
{
if ($repository->countJournals($currency) > 0) {
- Session::flash('error', 'Cannot destroy ' . e($currency->name) . ' because there are still transactions attached to it.');
+ Session::flash('error', trans('firefly.cannot_delete_currency', ['name' => $currency->name]));
return redirect(route('currency.index'));
}
- Session::flash('success', 'Currency "' . e($currency->name) . '" deleted');
+ Session::flash('success', trans('firefly.deleted_currency', ['name' => $currency->name]));
if (Auth::user()->hasRole('owner')) {
$currency->delete();
}
@@ -151,7 +151,7 @@ class CurrencyController extends Controller
if (!Auth::user()->hasRole('owner')) {
- Session::flash('warning', 'Please ask ' . env('SITE_OWNER') . ' to add, remove or edit currencies.');
+ Session::flash('warning', trans('firefly.ask_site_owner', ['owner' => env('SITE_OWNER')]));
}
@@ -170,7 +170,7 @@ class CurrencyController extends Controller
$data = $request->getCurrencyData();
if (Auth::user()->hasRole('owner')) {
$currency = $repository->store($data);
- Session::flash('success', 'Currency "' . $currency->name . '" created');
+ Session::flash('success', trans('firefly.created_currency', ['name' => $currency->name]));
}
@@ -199,7 +199,7 @@ class CurrencyController extends Controller
if (Auth::user()->hasRole('owner')) {
$currency = $repository->update($currency, $data);
}
- Session::flash('success', 'Currency "' . e($currency->name) . '" updated.');
+ Session::flash('success', trans('firefly.updated_currency', ['name' => $currency->name]));
Preferences::mark();
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index d30005be04..eda8736b29 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -302,6 +302,15 @@ return [
'edit_currency' => 'Edit currency ":name"',
'store_currency' => 'Store new currency',
'update_currency' => 'Update currency',
+ 'new_default_currency' => ':name is now the default currency.',
+ 'cannot_delete_currency' => 'Cannot delete :name because there are still transactions attached to it!',
+ 'deleted_currency' => 'Currency :name deleted',
+ 'created_currency' => 'Currency :name created',
+ 'updated_currency' => 'Currency :name updated',
+ 'ask_site_owner' => 'Please ask :owner to add, remove or edit currencies.',
+ 'currencies_intro' => 'Firefly III supports various currencies which you can set and enable here.',
+ 'make_default_currency' => 'make default',
+ 'default_currency' => 'default',
// new user:
'submit' => 'Submit',
diff --git a/resources/views/currency/index.twig b/resources/views/currency/index.twig
index 8449d1a9fa..f8fd9dbb50 100644
--- a/resources/views/currency/index.twig
+++ b/resources/views/currency/index.twig
@@ -9,18 +9,18 @@
<div class="col-lg-12 col-sm-12 col-md-12">
<div class="box">
<div class="box-header with-border">
- <h3 class="box-title">Currencies</h3>
+ <h3 class="box-title">{{ 'currencies'|_ }}</h3>
</div>
<div class="box-body">
<p class="text-info">
- Firefly III supports various currencies which you can set and enable here.
+ {{ 'currencies_intro'|_ }}
</p>
{% if currencies|length > 0 %}
<table class="table table-hover">
<thead>
<tr>
<th>&nbsp;</th>
- <th colspan="2">Currency</th>
+ <th colspan="2">{{ 'currency'|_ }}</th>
</tr>
</thead>
<tbody>
@@ -35,9 +35,9 @@
<td>{{ currency.name }} ({{ currency.code }}) ({{ currency.symbol|raw }})</td>
<td>
{% if currency.id == defaultCurrency.id %}
- <span class="label label-success">default</span>
+ <span class="label label-success">{{ 'default_currency'|_ }}</span>
{% else %}
- <a class="btn btn-info btn-xs" href="{{ route('currency.default',currency.id) }}">make default</a>
+ <a class="btn btn-info btn-xs" href="{{ route('currency.default',currency.id) }}">{{ 'make_default_currency'|_ }}</a>
{% endif %}
</td>
</tr>
@@ -47,7 +47,7 @@
{% endif %}
</div>
<div class="box-footer">
- <a class="btn btn-success pull-right" href="{{ route('currency.create') }}">Add another currency</a>
+ <a class="btn btn-success pull-right" href="{{ route('currency.create') }}">{{ 'create_currency'|_ }}</a>
</div>
</div>
</div>