From da38df6e4b2633a3c91ab3e64f1a12510d814f64 Mon Sep 17 00:00:00 2001 From: Florian Dupret Date: Fri, 29 May 2020 18:00:29 +0200 Subject: [PATCH] pluralization wave 1 --- app/Http/Controllers/TagController.php | 2 +- resources/lang/en_US/firefly.php | 33 ++++++++++--------- resources/views/v1/profile/index.twig | 2 +- resources/views/v1/rules/index.twig | 2 +- .../views/v1/rules/rule-group/delete.twig | 11 +++---- resources/views/v1/search/search.twig | 4 +-- resources/views/v1/transactions/convert.twig | 18 ++++++---- resources/views/v1/transactions/show.twig | 4 +-- 8 files changed, 42 insertions(+), 34 deletions(-) diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 85e9ff526a..0d5cba455c 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -217,7 +217,7 @@ class TagController extends Controller $count++; } } - session()->flash('success', (string) trans('firefly.deleted_x_tags', ['count' => $count])); + session()->flash('success', (string) trans_choice('firefly.deleted_x_tags', $count)); return redirect(route('tags.index')); } diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index b659364402..cbb07df26b 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -100,7 +100,7 @@ return [ 'two_factor_lost_fix_owner' => 'Otherwise, email the site owner, :site_owner and ask them to reset your two factor authentication.', 'mfa_backup_code' => 'You have used a backup code to login to Firefly III. It can\'t be used again, so cross it from your list.', 'pref_two_factor_new_backup_codes' => 'Get new backup codes', - 'pref_two_factor_backup_code_count' => 'You have :count valid backup code(s).', + 'pref_two_factor_backup_code_count' => 'You have one valid backup code.|You have :count valid backup codes.', '2fa_i_have_them' => 'I stored them!', 'warning_much_data' => ':days days of data may take a while to load.', 'registered' => 'You have registered successfully!', @@ -108,8 +108,8 @@ return [ 'no_budget_pointer' => 'You seem to have no budgets yet. You should create some on the budgets-page. Budgets can help you keep track of expenses.', 'Savings account' => 'Savings account', 'Credit card' => 'Credit card', - 'source_accounts' => 'Source account(s)', - 'destination_accounts' => 'Destination account(s)', + 'source_accounts' => 'Source account|Source accounts', + 'destination_accounts' => 'Destination account|Destination accounts', 'user_id_is' => 'Your user id is :user', 'field_supports_markdown' => 'This field supports Markdown.', 'need_more_help' => 'If you need more help using Firefly III, please open a ticket on Github.', @@ -126,8 +126,8 @@ return [ 'sum_of_income' => 'Sum of income', 'liabilities' => 'Liabilities', 'spent_in_specific_budget' => 'Spent in budget ":budget"', - 'spent_in_specific_double' => 'Spent in account(s) ":account"', - 'earned_in_specific_double' => 'Earned in account(s) ":account"', + 'spent_in_specific_double' => 'Spent in account ":account"', + 'earned_in_specific_double' => 'Earned in account ":account"', 'source_account' => 'Source account', 'source_account_reconciliation' => 'You can\'t edit the source account of a reconciliation transaction.', 'destination_account' => 'Destination account', @@ -251,7 +251,8 @@ return [ // search 'search' => 'Search', 'search_query' => 'Query', - 'search_found_transactions' => 'Firefly III found :count transaction(s) in :time seconds.', + 'search_found_transactions' => 'Firefly III found one transaction in :time seconds.|Firefly III found :count transactions in :time seconds.', + 'search_found_more_transactions' => 'Firefly III found more than :count transactions in :time seconds.', 'search_for_query' => 'Firefly III is searching for transactions with all of these words in them: :query', 'search_modifier_amount_is' => 'Amount is exactly :value', 'search_modifier_amount' => 'Amount is exactly :value', @@ -318,7 +319,7 @@ return [ 'no_rules_in_group' => 'There are no rules in this group', 'move_rule_group_up' => 'Move rule group up', 'move_rule_group_down' => 'Move rule group down', - 'save_rules_by_moving' => 'Save these rule(s) by moving them to another rule group:', + 'save_rules_by_moving' => 'Save this rule by moving it to another rule group:|Save these rules by moving them to another rule group:', 'make_new_rule' => 'Make a new rule in rule group ":title"', 'make_new_rule_no_group' => 'Make a new rule', 'instructions_rule_from_bill' => 'In order to match transactions to your new bill ":name", Firefly III can create a rule that will automatically be checked against any transactions you store. Please verify the details below and store the rule to have Firefly III automatically match transactions to your new bill.', @@ -428,7 +429,7 @@ return [ 'rule_trigger_currency_is_choice' => 'Transaction currency is..', 'rule_trigger_currency_is' => 'Transaction currency is ":trigger_value"', 'rule_trigger_has_attachments_choice' => 'Has at least this many attachments', - 'rule_trigger_has_attachments' => 'Has at least :trigger_value attachment(s)', + 'rule_trigger_has_attachments' => 'Has at least one attachment|Has at least :trigger_value attachment(s)', 'rule_trigger_store_journal' => 'When a transaction is created', 'rule_trigger_update_journal' => 'When a transaction is updated', 'rule_trigger_has_no_category_choice' => 'Has no category', @@ -526,7 +527,7 @@ return [ 'clear_location' => 'Clear location', 'delete_all_selected_tags' => 'Delete all selected tags', 'select_tags_to_delete' => 'Don\'t forget to select some tags.', - 'deleted_x_tags' => 'Deleted :count tag(s).', + 'deleted_x_tags' => 'Deleted one tag.|Deleted :count tags.', 'create_rule_from_transaction' => 'Create rule based on transaction', // preferences @@ -694,12 +695,14 @@ return [ 'convert_please_set_asset_destination' => 'Please pick the asset account where the money will go to.', 'convert_please_set_expense_destination' => 'Please pick the expense account where the money will go to.', 'convert_please_set_asset_source' => 'Please pick the asset account where the money will come from.', - 'convert_expl_w_d' => 'When converting from a withdrawal to a deposit, the money will be deposited into the displayed destination account(s), instead of being withdrawn from them. To complete the conversion, please set the new source account(s) below.', - 'convert_expl_w_t' => 'When converting a withdrawal into a transfer, the money will be transferred away from the source account(s) into other asset or liability account(s) instead of being spent on the original expense accounts. To complete the conversion, please select new destination account(s).', - 'convert_expl_d_w' => 'When converting a deposit into a withdrawal, the money will be withdrawn from the displayed source account(s), instead of being deposited into them. To complete the conversion, please select new destination accounts.', - 'convert_expl_d_t' => 'When you convert a deposit into a transfer, the money will be deposited into the listed destination account(s) from any of your asset or liability account(s). Please select the new source account(s) to complete the conversion.', - 'convert_expl_t_w' => 'When you convert a transfer into a withdrawal, the money will be spent on the destination account(s) you set here, instead of being transferred away. Please select the new destination account(s) to complete the conversion.', - 'convert_expl_t_d' => 'When you convert a transfer into a deposit, the money will be deposited into the destination account(s) you see here, instead of being transferred into them. Please select the new source account(s) to complete the conversion.', + 'convert_expl_w_d' => 'When converting from a withdrawal to a deposit, the money will be deposited into the displayed destination account, instead of being withdrawn from it.|When converting from a withdrawal to a deposit, the money will be deposited into the displayed destination accounts, instead of being withdrawn from them.', + 'convert_expl_w_t' => 'When converting a withdrawal into a transfer, the money will be transferred away from the source account into other asset or liability account instead of being spent on the original expense account.|When converting a withdrawal into a transfer, the money will be transferred away from the source accounts into other asset or liability accounts instead of being spent on the original expense accounts.', + 'convert_expl_d_w' => 'When converting a deposit into a withdrawal, the money will be withdrawn from the displayed source account, instead of being deposited into it.|When converting a deposit into a withdrawal, the money will be withdrawn from the displayed source accounts, instead of being deposited into them. To complete the conversion, please select new destination accounts.', + 'convert_expl_d_t' => 'When you convert a deposit into a transfer, the money will be deposited into the listed destination account from any of your asset or liability account.|When you convert a deposit into a transfer, the money will be deposited into the listed destination accounts from any of your asset or liability accounts.', + 'convert_expl_t_w' => 'When you convert a transfer into a withdrawal, the money will be spent on the destination account you set here, instead of being transferred away.|When you convert a transfer into a withdrawal, the money will be spent on the destination accounts you set here, instead of being transferred away.', + 'convert_expl_t_d' => 'When you convert a transfer into a deposit, the money will be deposited into the destination account you see here, instead of being transferred into it.|When you convert a transfer into a deposit, the money will be deposited into the destination account(s) you see here, instead of being transferred into them.', + 'convert_select_sources' => 'To complete the conversion, please set the new source account below.|To complete the conversion, please set the new source accounts below.', + 'convert_select_destinations' => 'To complete the conversion, please select the new destination account below.|To complete the conversion, please select the new destination accounts below.', 'converted_to_Withdrawal' => 'The transaction has been converted to a withdrawal', 'converted_to_Deposit' => 'The transaction has been converted to a deposit', 'converted_to_Transfer' => 'The transaction has been converted to a transfer', diff --git a/resources/views/v1/profile/index.twig b/resources/views/v1/profile/index.twig index 2e8a109d9f..c33460bfbd 100644 --- a/resources/views/v1/profile/index.twig +++ b/resources/views/v1/profile/index.twig @@ -102,7 +102,7 @@

{{ 'pref_two_factor_auth_help'|_ }}

{% if enabled2FA == true %}

- {{ trans('firefly.pref_two_factor_backup_code_count', {count: mfaBackupCount}) }} + {{ trans_choice('firefly.pref_two_factor_backup_code_count', mfaBackupCount) }}

diff --git a/resources/views/v1/rules/index.twig b/resources/views/v1/rules/index.twig index 059b00707b..e1090a2a00 100644 --- a/resources/views/v1/rules/index.twig +++ b/resources/views/v1/rules/index.twig @@ -150,7 +150,7 @@ {% if not rule.active %} class="text-muted" {% endif %} - data-id="{{ trigger.id }}">{{ trans(('firefly.rule_trigger_' ~ trigger.trigger_type), {trigger_value: trigger.trigger_value}) }} + data-id="{{ trigger.id }}">{{ trans_choice(('firefly.rule_trigger_' ~ trigger.trigger_type), trigger.trigger_value, {trigger_value: trigger.trigger_value}) }} {% if trigger.stop_processing %} diff --git a/resources/views/v1/rules/rule-group/delete.twig b/resources/views/v1/rules/rule-group/delete.twig index 332cd444c1..32e5b472cf 100644 --- a/resources/views/v1/rules/rule-group/delete.twig +++ b/resources/views/v1/rules/rule-group/delete.twig @@ -23,15 +23,14 @@ {{ trans('form.ruleGroup_areYouSure', {'title': ruleGroup.title}) }}

-

- {% if ruleGroup.rules|length > 0 %} - {{ Lang.choice('form.also_delete_rules', ruleGroup.rules|length, {count: ruleGroup.rules|length}) }} - {% endif %} -

{% if ruleGroup.rules|length > 0 %} +

+ {{ trans_choice('form.also_delete_rules', ruleGroup.rules|length) }} +

+

- {{ 'save_rules_by_moving'|_ }} + {{ trans_choice('firefly.save_rules_by_moving', ruleGroup.rules|length) }}

diff --git a/resources/views/v1/search/search.twig b/resources/views/v1/search/search.twig index d200bad228..f28c3b9f69 100644 --- a/resources/views/v1/search/search.twig +++ b/resources/views/v1/search/search.twig @@ -1,9 +1,9 @@

{% if hasPages %} - {{ trans('firefly.search_found_transactions', {count: '>'~groups.perPage, time: searchTime}) }} + {{ trans('firefly.search_found_more_transactions', {count: groups.perPage, time: searchTime}) }} {% else %} - {{ trans('firefly.search_found_transactions', {count: groups.count, time: searchTime}) }} + {{ trans_choice('firefly.search_found_transactions', groups.count, {time: searchTime}) }} {% endif %}

diff --git a/resources/views/v1/transactions/convert.twig b/resources/views/v1/transactions/convert.twig index f798d95c14..266cf37c06 100644 --- a/resources/views/v1/transactions/convert.twig +++ b/resources/views/v1/transactions/convert.twig @@ -19,32 +19,38 @@

{# ONE: WITHDRAWAL TO DEPOSIT #} {% if sourceType.type == 'Withdrawal' and destinationType.type == 'Deposit' %} - {{ 'convert_expl_w_d'|_ }} + {{ trans_choice('firefly.convert_expl_w_d', groupArray.transactions|length) }} + {{ trans_choice('firefly.convert_select_sources', groupArray.transactions|length) }} {% endif %} {# TWO: WITHDRAWAL TO TRANSFER #} {% if sourceType.type == 'Withdrawal' and destinationType.type == 'Transfer' %} - {{ 'convert_expl_w_t'|_ }} + {{ trans_choice('firefly.convert_expl_w_t', groupArray.transactions|length) }} + {{ trans_choice('firefly.convert_select_destinations', groupArray.transactions|length) }} {% endif %} {# THREE: DEPOSIT TO WITHDRAWAL #} {% if sourceType.type == 'Deposit' and destinationType.type == 'Withdrawal' %} - {{ 'convert_expl_d_w'|_ }} + {{ trans_choice('firefly.convert_expl_d_w', groupArray.transactions|length) }} + {{ trans_choice('firefly.convert_select_destinations', groupArray.transactions|length) }} {% endif %} {# FOUR: DEPOSIT TO TRANSFER#} {% if sourceType.type == 'Deposit' and destinationType.type == 'Transfer' %} - {{ 'convert_expl_d_t'|_ }} + {{ trans_choice('firefly.convert_expl_d_t', groupArray.transactions|length) }} + {{ trans_choice('firefly.convert_select_sources', groupArray.transactions|length) }} {% endif %} {# FIVE: TRANSFER TO WITHDRAWAL #} {% if sourceType.type == 'Transfer' and destinationType.type == 'Withdrawal' %} - {{ 'convert_expl_t_w'|_ }} + {{ trans_choice('firefly.convert_expl_t_w', groupArray.transactions|length) }} + {{ trans_choice('firefly.convert_select_destinations', groupArray.transactions|length) }} {% endif %} {# SIX: TRANSFER TO DEPOSIT #} {% if sourceType.type == 'Transfer' and destinationType.type == 'Deposit' %} - {{ 'convert_expl_t_d'|_ }} + {{ trans_choice('firefly.convert_expl_t_d', groupArray.transactions|length) }} + {{ trans_choice('firefly.convert_select_sources', groupArray.transactions|length) }} {% endif %}

diff --git a/resources/views/v1/transactions/show.twig b/resources/views/v1/transactions/show.twig index c0b3c81da9..50855cf52e 100644 --- a/resources/views/v1/transactions/show.twig +++ b/resources/views/v1/transactions/show.twig @@ -82,7 +82,7 @@ {% if first.transactiontype.type != 'Withdrawal' or splits == 1 %} - {{ 'source_accounts'|_ }} + {{ trans_choice('firefly.source_accounts', groupArray.transactions|length ) }} {% for journal in groupArray.transactions %} @@ -103,7 +103,7 @@ {% if first.transactiontype.type != 'Deposit' or splits == 1 %} - {{ 'destination_accounts'|_ }} + {{ trans_choice('firefly.destination_accounts', groupArray.transactions|length ) }}