From d580bf8f432a563314668e73c835f6aa714339b2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 29 Feb 2020 13:58:34 +0100 Subject: [PATCH] Fix untranslatable strings #3159 --- app/Http/Controllers/Transaction/ShowController.php | 2 +- app/Repositories/Account/AccountRepository.php | 4 +++- resources/lang/en_US/breadcrumbs.php | 1 + resources/lang/en_US/firefly.php | 10 ++++++++++ resources/views/v1/layout/default.twig | 6 +++--- resources/views/v1/transactions/show.twig | 2 +- 6 files changed, 19 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Transaction/ShowController.php b/app/Http/Controllers/Transaction/ShowController.php index 2bdbf51361..390d025fe9 100644 --- a/app/Http/Controllers/Transaction/ShowController.php +++ b/app/Http/Controllers/Transaction/ShowController.php @@ -88,7 +88,7 @@ class ShowController extends Controller throw new FireflyException('This transaction is broken :(.'); } - $type = $first->transactionType->type; + $type = (string)trans(sprintf('firefly.%s',$first->transactionType->type)); $title = 1 === $splits ? $first->description : $transactionGroup->title; $subTitle = sprintf('%s: "%s"', $type, $title); diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 803c859e5a..c933e7c835 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -473,7 +473,9 @@ class AccountRepository implements AccountRepositoryInterface if (AccountType::ASSET !== $account->accountType->type) { throw new FireflyException(sprintf('%s is not an asset account.', $account->name)); } - $name = $account->name . ' reconciliation'; + + $name = trans('firefly.reconciliation_account_name', ['name' => $account->name]); + /** @var AccountType $type */ $type = AccountType::where('type', AccountType::RECONCILIATION)->first(); $accounts = $this->user->accounts()->where('account_type_id', $type->id)->get(); diff --git a/resources/lang/en_US/breadcrumbs.php b/resources/lang/en_US/breadcrumbs.php index 5a122ee49f..c44a23ae7e 100644 --- a/resources/lang/en_US/breadcrumbs.php +++ b/resources/lang/en_US/breadcrumbs.php @@ -51,6 +51,7 @@ return [ 'edit_journal' => 'Edit transaction ":description"', 'edit_reconciliation' => 'Edit ":description"', 'delete_journal' => 'Delete transaction ":description"', + 'delete_group' => 'Delete transaction ":description"', 'tags' => 'Tags', 'createTag' => 'Create new tag', 'edit_tag' => 'Edit tag ":tag"', diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index f9fb55e2e9..818cd74363 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -205,6 +205,7 @@ return [ 'active_exp_bills_only' => 'active and expected bills only', 'average_per_bill' => 'average per bill', 'expected_total' => 'expected total', + 'reconciliation_account_name' => ':name reconciliation', // API access 'authorization_request' => 'Firefly III v:version Authorization Request', 'authorization_request_intro' => ':client is requesting permission to access your financial administration. Would you like to authorize :client to access these records?', @@ -215,6 +216,8 @@ return [ 'name_in_currency' => ':name in :currency', 'paid_in_currency' => 'Paid in :currency', 'unpaid_in_currency' => 'Unpaid in :currency', + 'is_alpha_warning' => 'You are running an ALPHA version. Be wary of bugs and issues.', + 'is_beta_warning' => 'You are running an BETA version. Be wary of bugs and issues.', // check for updates: 'update_check_title' => 'Check for updates', @@ -1391,6 +1394,13 @@ return [ '(partially) refunds_outward' => '(partially) refunds', '(partially) pays for_outward' => '(partially) pays for', '(partially) reimburses_outward' => '(partially) reimburses', + 'is (partially) refunded by' => 'is (partially) refunded by', + 'is (partially) paid for by' => 'is (partially) paid for by', + 'is (partially) reimbursed by' => 'is (partially) reimbursed by', + 'relates to' => 'relates to', + '(partially) refunds' => '(partially) refunds', + '(partially) pays for' => '(partially) pays for', + '(partially) reimburses' => '(partially) reimburses', // split a transaction: 'splits' => 'Splits', diff --git a/resources/views/v1/layout/default.twig b/resources/views/v1/layout/default.twig index 0079b09057..6e32bfad78 100644 --- a/resources/views/v1/layout/default.twig +++ b/resources/views/v1/layout/default.twig @@ -141,9 +141,9 @@ {{ 'version'|_ }} {{ Config.get('firefly.version') }} Firefly III - Developed by James Cole, the source code is licensed under the AGPL-3.0-or-later. - {% if FF_IS_ALPHA %}
You are running an ALPHA version. Be wary of bugs and issues.
{% endif %} - {% if FF_IS_BETA %}
You are running an BETA version. Be wary of bugs and issues.
{% endif %} + © James Cole, AGPL-3.0-or-later. + {% if FF_IS_ALPHA %}
{{ 'is_alpha_warning'|_ }}
{% endif %} + {% if FF_IS_BETA %}
{{ 'is_beta_warning'|_ }}
{% endif %} {% include('partials.control-bar') %} diff --git a/resources/views/v1/transactions/show.twig b/resources/views/v1/transactions/show.twig index d2302d89bd..afca3a843e 100644 --- a/resources/views/v1/transactions/show.twig +++ b/resources/views/v1/transactions/show.twig @@ -302,7 +302,7 @@ - {{ link.link }} "{{ trans('firefly.'~link.link) }} "{{ link.description }}" ({{ link.amount|raw }})