LDAP Wizard: proper strings and translations for user and group count text

This commit is contained in:
Arthur Schiwon 2013-10-23 12:20:13 +02:00
parent d78a80a689
commit 30c0f5dee6
3 changed files with 11 additions and 5 deletions

View File

@ -73,8 +73,10 @@ class Wizard extends LDAPUtility {
$base = $this->configuration->ldapBase[0];
$filter = $this->configuration->ldapGroupFilter;
\OCP\Util::writeLog('user_ldap', 'Wiz: g filter '. print_r($filter, true), \OCP\Util::DEBUG);
$l = \OC_L10N::get('user_ldap');
if(empty($filter)) {
$this->result->addChange('ldap_group_count', 0);
$output = $l->n('%s group found', '%s groups found', 0, array(0));
$this->result->addChange('ldap_group_count', $output);
return $this->result;
}
$cr = $this->getConnection();
@ -87,7 +89,8 @@ class Wizard extends LDAPUtility {
}
$entries = $this->ldap->countEntries($cr, $rr);
$entries = ($entries !== false) ? $entries : 0;
$this->result->addChange('ldap_group_count', $entries);
$output = $l->n('%s group found', '%s groups found', $entries, $entries);
$this->result->addChange('ldap_group_count', $output);
return $this->result;
}
@ -116,11 +119,14 @@ class Wizard extends LDAPUtility {
}
$entries = $this->ldap->countEntries($cr, $rr);
$entries = ($entries !== false) ? $entries : 0;
$this->result->addChange('ldap_user_count', $entries);
$l = \OC_L10N::get('user_ldap');
$output = $l->n('%s user found', '%s users found', $entries, $entries);
$this->result->addChange('ldap_user_count', $output);
return $this->result;
}
public function determineAttributes() {
if(!$this->checkRequirements(array('ldapHost',
'ldapPort',

View File

@ -35,7 +35,7 @@
<div class="ldapWizardInfo invisible">&nbsp;</div>
</p>
<p>
<span id="ldap_group_count">0</span> <span><?php p($l->t('group(s) found'));?></span>
<span id="ldap_group_count">0 <?php p($l->t('groups found'));?></span>
</p>
<?php print_unescaped($_['wizardControls']); ?>
</div>

View File

@ -35,7 +35,7 @@
<div class="ldapWizardInfo invisible">&nbsp;</div>
</p>
<p>
<span id="ldap_user_count">0</span> <span><?php p($l->t('user(s) found'));?></span>
<span id="ldap_user_count">0 <?php p($l->t('users found'));?></span>
</p>
<?php print_unescaped($_['wizardControls']); ?>
</div>