summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-10-18 23:34:18 +0200
committermsquare <msquare@notrademark.de>2018-10-30 22:50:22 +0100
commitb443b53919f50bd0176e7b67dfd1efc28276a770 (patch)
treedf4d089d9d431f5223a71e6b40f9d87361705929 /includes
parent90e1a949623ead173c0952f802d7b5c5487251b1 (diff)
Translation: added pluralization support
Diffstat (limited to 'includes')
-rw-r--r--includes/controller/user_angeltypes_controller.php13
-rw-r--r--includes/view/ShiftCalendarShiftRenderer.php6
-rw-r--r--includes/view/User_view.php5
3 files changed, 12 insertions, 12 deletions
diff --git a/includes/controller/user_angeltypes_controller.php b/includes/controller/user_angeltypes_controller.php
index aa614cf3..734bd1e9 100644
--- a/includes/controller/user_angeltypes_controller.php
+++ b/includes/controller/user_angeltypes_controller.php
@@ -23,10 +23,15 @@ function user_angeltypes_unconfirmed_hint()
. '</a>';
}
- return sprintf(ngettext('There is %d unconfirmed angeltype.', 'There are %d unconfirmed angeltypes.',
- count($unconfirmed_user_angeltypes)),
- count($unconfirmed_user_angeltypes)) . ' ' . __('Angel types which need approvals:') . ' ' . join(', ',
- $unconfirmed_links);
+ $count = count($unconfirmed_user_angeltypes);
+ return _e(
+ 'There is %d unconfirmed angeltype.',
+ 'There are %d unconfirmed angeltypes.',
+ $count,
+ [$count]
+ )
+ . ' ' . __('Angel types which need approvals:')
+ . ' ' . join(', ', $unconfirmed_links);
}
/**
diff --git a/includes/view/ShiftCalendarShiftRenderer.php b/includes/view/ShiftCalendarShiftRenderer.php
index 9e40b1c6..80cea241 100644
--- a/includes/view/ShiftCalendarShiftRenderer.php
+++ b/includes/view/ShiftCalendarShiftRenderer.php
@@ -175,10 +175,8 @@ class ShiftCalendarShiftRenderer
$angeltype,
$shift_entries
);
- $inner_text = sprintf(
- ngettext('%d helper needed', '%d helpers needed', $shift_signup_state->getFreeEntries()),
- $shift_signup_state->getFreeEntries()
- );
+ $freeEntriesCount = $shift_signup_state->getFreeEntries();
+ $inner_text = _e('%d helper needed', '%d helpers needed', $freeEntriesCount, [$freeEntriesCount]);
switch ($shift_signup_state->getState()) {
case ShiftSignupState::ADMIN:
diff --git a/includes/view/User_view.php b/includes/view/User_view.php
index fb541619..f8160765 100644
--- a/includes/view/User_view.php
+++ b/includes/view/User_view.php
@@ -727,10 +727,7 @@ function User_view_state_admin($freeloader, $user_source)
if ($user_source['got_voucher'] > 0) {
$state[] = '<span class="text-success">'
. glyph('cutlery')
- . sprintf(
- ngettext('Got %s voucher', 'Got %s vouchers', $user_source['got_voucher']),
- $user_source['got_voucher']
- )
+ . _e('Got %s voucher', 'Got %s vouchers', $user_source['got_voucher'], [$user_source['got_voucher']])
. '</span>';
} else {
$state[] = '<span class="text-danger">' . __('Got no vouchers') . '</span>';