Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix plural usage in LDAP wizard
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Aug 22, 2022
commit ef60257110bd850521cfa5d3ff8a1e4dc85b4fcd
33 changes: 20 additions & 13 deletions apps/user_ldap/lib/Wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function countGroups() {
$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;
}
Expand All @@ -152,12 +152,16 @@ public function countGroups() {
}
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;
}
Expand All @@ -170,12 +174,15 @@ public function countUsers() {
$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;
}
Expand Down