Cast all translations to strings.

This commit is contained in:
James Cole
2018-07-15 09:38:49 +02:00
parent 369839e012
commit 7b41c5b301
99 changed files with 335 additions and 336 deletions

View File

@@ -261,7 +261,7 @@ class Transaction extends Twig_Extension
}
if (AccountType::CASH === $type) {
$txt = '<span class="text-success">(' . trans('firefly.cash') . ')</span>';
$txt = '<span class="text-success">(' . (string)trans('firefly.cash') . ')</span>';
return $txt;
}
@@ -310,19 +310,19 @@ class Transaction extends Twig_Extension
{
switch ($transaction->transaction_type_type) {
case TransactionType::WITHDRAWAL:
$txt = sprintf('<i class="fa fa-long-arrow-left fa-fw" title="%s"></i>', trans('firefly.withdrawal'));
$txt = sprintf('<i class="fa fa-long-arrow-left fa-fw" title="%s"></i>', (string)trans('firefly.withdrawal'));
break;
case TransactionType::DEPOSIT:
$txt = sprintf('<i class="fa fa-long-arrow-right fa-fw" title="%s"></i>', trans('firefly.deposit'));
$txt = sprintf('<i class="fa fa-long-arrow-right fa-fw" title="%s"></i>', (string)trans('firefly.deposit'));
break;
case TransactionType::TRANSFER:
$txt = sprintf('<i class="fa fa-fw fa-exchange" title="%s"></i>', trans('firefly.transfer'));
$txt = sprintf('<i class="fa fa-fw fa-exchange" title="%s"></i>', (string)trans('firefly.transfer'));
break;
case TransactionType::OPENING_BALANCE:
$txt = sprintf('<i class="fa-fw fa fa-star-o" title="%s"></i>', trans('firefly.opening_balance'));
$txt = sprintf('<i class="fa-fw fa fa-star-o" title="%s"></i>', (string)trans('firefly.opening_balance'));
break;
case TransactionType::RECONCILIATION:
$txt = sprintf('<i class="fa-fw fa fa-calculator" title="%s"></i>', trans('firefly.reconciliation_transaction'));
$txt = sprintf('<i class="fa-fw fa fa-calculator" title="%s"></i>', (string)trans('firefly.reconciliation_transaction'));
break;
default:
$txt = '';
@@ -412,7 +412,7 @@ class Transaction extends Twig_Extension
}
if (AccountType::CASH === $type) {
$txt = '<span class="text-success">(' . trans('firefly.cash') . ')</span>';
$txt = '<span class="text-success">(' . (string)trans('firefly.cash') . ')</span>';
return $txt;
}

View File

@@ -43,7 +43,7 @@ class Rule extends Twig_Extension
$ruleActions = array_keys(Config::get('firefly.rule-actions'));
$possibleActions = [];
foreach ($ruleActions as $key) {
$possibleActions[$key] = trans('firefly.rule_action_' . $key . '_choice');
$possibleActions[$key] = (string)trans('firefly.rule_action_' . $key . '_choice');
}
unset($key, $ruleActions);
asort($possibleActions);
@@ -62,8 +62,8 @@ class Rule extends Twig_Extension
'allJournalTriggers',
function () {
return [
'store-journal' => trans('firefly.rule_trigger_store_journal'),
'update-journal' => trans('firefly.rule_trigger_update_journal'),
'store-journal' => (string)trans('firefly.rule_trigger_store_journal'),
'update-journal' => (string)trans('firefly.rule_trigger_update_journal'),
];
}
);
@@ -81,7 +81,7 @@ class Rule extends Twig_Extension
$possibleTriggers = [];
foreach ($ruleTriggers as $key) {
if ('user_action' !== $key) {
$possibleTriggers[$key] = trans('firefly.rule_trigger_' . $key . '_choice');
$possibleTriggers[$key] = (string)trans('firefly.rule_trigger_' . $key . '_choice');
}
}
unset($key, $ruleTriggers);