Some forgotten translations.

This commit is contained in:
James Cole
2016-01-23 09:10:22 +01:00
parent 27c45eface
commit 664fde2344
3 changed files with 22 additions and 13 deletions

View File

@@ -60,7 +60,7 @@ class CurrencyController extends Controller
Preferences::set('currencyPreference', $currency->code); Preferences::set('currencyPreference', $currency->code);
Preferences::mark(); 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('FFCURRENCYSYMBOL');
Cache::forget('FFCURRENCYCODE'); Cache::forget('FFCURRENCYCODE');
@@ -78,7 +78,7 @@ class CurrencyController extends Controller
{ {
if ($repository->countJournals($currency) > 0) { 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')); return redirect(route('currency.index'));
} }
@@ -103,12 +103,12 @@ class CurrencyController extends Controller
public function destroy(CurrencyRepositoryInterface $repository, TransactionCurrency $currency) public function destroy(CurrencyRepositoryInterface $repository, TransactionCurrency $currency)
{ {
if ($repository->countJournals($currency) > 0) { 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')); 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')) { if (Auth::user()->hasRole('owner')) {
$currency->delete(); $currency->delete();
} }
@@ -151,7 +151,7 @@ class CurrencyController extends Controller
if (!Auth::user()->hasRole('owner')) { 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(); $data = $request->getCurrencyData();
if (Auth::user()->hasRole('owner')) { if (Auth::user()->hasRole('owner')) {
$currency = $repository->store($data); $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')) { if (Auth::user()->hasRole('owner')) {
$currency = $repository->update($currency, $data); $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(); Preferences::mark();

View File

@@ -302,6 +302,15 @@ return [
'edit_currency' => 'Edit currency ":name"', 'edit_currency' => 'Edit currency ":name"',
'store_currency' => 'Store new currency', 'store_currency' => 'Store new currency',
'update_currency' => 'Update 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: // new user:
'submit' => 'Submit', 'submit' => 'Submit',

View File

@@ -9,18 +9,18 @@
<div class="col-lg-12 col-sm-12 col-md-12"> <div class="col-lg-12 col-sm-12 col-md-12">
<div class="box"> <div class="box">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title">Currencies</h3> <h3 class="box-title">{{ 'currencies'|_ }}</h3>
</div> </div>
<div class="box-body"> <div class="box-body">
<p class="text-info"> <p class="text-info">
Firefly III supports various currencies which you can set and enable here. {{ 'currencies_intro'|_ }}
</p> </p>
{% if currencies|length > 0 %} {% if currencies|length > 0 %}
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
<th colspan="2">Currency</th> <th colspan="2">{{ 'currency'|_ }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -35,9 +35,9 @@
<td>{{ currency.name }} ({{ currency.code }}) ({{ currency.symbol|raw }})</td> <td>{{ currency.name }} ({{ currency.code }}) ({{ currency.symbol|raw }})</td>
<td> <td>
{% if currency.id == defaultCurrency.id %} {% if currency.id == defaultCurrency.id %}
<span class="label label-success">default</span> <span class="label label-success">{{ 'default_currency'|_ }}</span>
{% else %} {% 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 %} {% endif %}
</td> </td>
</tr> </tr>
@@ -47,7 +47,7 @@
{% endif %} {% endif %}
</div> </div>
<div class="box-footer"> <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> </div>
</div> </div>