From 4adfee4ebabd13b647e8b0f718d24937249e0218 Mon Sep 17 00:00:00 2001
From: Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de>
Date: Fri, 29 Apr 2022 14:38:12 +0000
Subject: [PATCH] avoid translating title twice, fixes #990

Closes #990
---
 lib/functions.php | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/functions.php b/lib/functions.php
index bbed6298f50..6a73fc82103 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;
 }
 
 /**
-- 
GitLab