]> source.dussan.org Git - nextcloud-server.git/commitdiff
LDAP Wizard: proper strings and translations for user and group count text
authorArthur Schiwon <blizzz@owncloud.com>
Wed, 23 Oct 2013 10:20:13 +0000 (12:20 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Wed, 23 Oct 2013 10:20:13 +0000 (12:20 +0200)
apps/user_ldap/lib/wizard.php
apps/user_ldap/templates/part.wizard-groupfilter.php
apps/user_ldap/templates/part.wizard-userfilter.php

index 7b7ef45af478c6a3dac5cbebfd47cc8d90bd154b..9b84c3d5a44e8453cd2481ee93f6e491baf34776 100644 (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',
index 17ce815589a66550423df64375a204f1645b5e6e..0cc4dfa572a3aac5bf2efe6860a579205a4b7637 100644 (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>
index 146e6bb739a26e2919419359c595eaad6374f03f..c1d522ce2a6b6fd8ba4204dff410723c97e7b22f 100644 (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>