diff options
author | Joas Schilling <coding@schilljs.com> | 2022-08-22 14:14:47 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-08-22 14:14:47 +0200 |
commit | ef60257110bd850521cfa5d3ff8a1e4dc85b4fcd (patch) | |
tree | 887d8c7da238f5bf62880393b85321ae0fb689b8 /apps/user_ldap | |
parent | fd645d48028335f65c567e708b80942f995f78d9 (diff) | |
download | nextcloud-server-ef60257110bd850521cfa5d3ff8a1e4dc85b4fcd.tar.gz nextcloud-server-ef60257110bd850521cfa5d3ff8a1e4dc85b4fcd.zip |
Fix plural usage in LDAP wizard
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/lib/Wizard.php | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php index ae9546be08b..da2b92d9873 100644 --- a/apps/user_ldap/lib/Wizard.php +++ b/apps/user_ldap/lib/Wizard.php @@ -138,7 +138,7 @@ class Wizard extends LDAPUtility { $filter = $this->configuration->ldapGroupFilter; if (empty($filter)) { - $output = self::$l->n('%s group found', '%s groups found', 0, [0]); + $output = self::$l->n('%n group found', '%n groups found', 0); $this->result->addChange('ldap_group_count', $output); return $this->result; } @@ -152,12 +152,16 @@ class Wizard extends LDAPUtility { } return false; } - $output = self::$l->n( - '%s group found', - '%s groups found', - $groupsTotal, - [$this->formatCountResult($groupsTotal)] - ); + + if ($groupsTotal > 1000) { + $output = self::$l->t('> 1000 groups found'); + } else { + $output = self::$l->n( + '%n group found', + '%n groups found', + $groupsTotal + ); + } $this->result->addChange('ldap_group_count', $output); return $this->result; } @@ -170,12 +174,15 @@ class Wizard extends LDAPUtility { $filter = $this->access->getFilterForUserCount(); $usersTotal = $this->countEntries($filter, 'users'); - $output = self::$l->n( - '%s user found', - '%s users found', - $usersTotal, - [$this->formatCountResult($usersTotal)] - ); + if ($usersTotal > 1000) { + $output = self::$l->t('> 1000 users found'); + } else { + $output = self::$l->n( + '%n user found', + '%n users found', + $usersTotal + ); + } $this->result->addChange('ldap_user_count', $output); return $this->result; } |