aboutsummaryrefslogtreecommitdiff
path: root/lib/functions.php
diff options
context:
space:
mode:
authorElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2022-04-29 14:38:12 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2022-04-29 14:38:12 +0000
commit4adfee4ebabd13b647e8b0f718d24937249e0218 (patch)
tree192efabd4ab2d438e55d20573eb1e72e9fdc1f7e /lib/functions.php
parent22094d298325adc9cf45c1b573092217490ae5fb (diff)
avoid translating title twice, fixes #990
Closes #990
Diffstat (limited to 'lib/functions.php')
-rw-r--r--lib/functions.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/functions.php b/lib/functions.php
index bbed629..6a73fc8 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -1172,16 +1172,17 @@ function get_title_for_status($type, $count, $sem_type = NULL)
}
$atype = 'title_'.$type;
+ $index = $count == 1 ? 0 : 1;
- if (is_array($SEM_TYPE[$sem_type][$atype])) {
- $title = $SEM_TYPE[$sem_type][$atype];
- } else if (isset($DEFAULT_TITLE_FOR_STATUS[$type])) {
- $title = $DEFAULT_TITLE_FOR_STATUS[$type];
+ if (isset($SEM_TYPE[$sem_type][$atype][$index])) {
+ $title = $SEM_TYPE[$sem_type][$atype][$index];
+ } else if (isset($DEFAULT_TITLE_FOR_STATUS[$type][$index])) {
+ $title = $DEFAULT_TITLE_FOR_STATUS[$type][$index];
} else {
- $title = ['unbekannt', 'unbekannt'];
+ $title = _('unbekannt');
}
- return ngettext($title[0], $title[1], $count);
+ return $title;
}
/**