From 30c0f5dee602e8b09963f2be5234eeff04193eb5 Mon Sep 17 00:00:00 2001
From: Arthur Schiwon
Date: Wed, 23 Oct 2013 12:20:13 +0200
Subject: [PATCH] LDAP Wizard: proper strings and translations for user and
group count text
---
apps/user_ldap/lib/wizard.php | 12 +++++++++---
apps/user_ldap/templates/part.wizard-groupfilter.php | 2 +-
apps/user_ldap/templates/part.wizard-userfilter.php | 2 +-
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php
index 7b7ef45af4..9b84c3d5a4 100644
--- a/apps/user_ldap/lib/wizard.php
+++ b/apps/user_ldap/lib/wizard.php
@@ -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',
diff --git a/apps/user_ldap/templates/part.wizard-groupfilter.php b/apps/user_ldap/templates/part.wizard-groupfilter.php
index 17ce815589..0cc4dfa572 100644
--- a/apps/user_ldap/templates/part.wizard-groupfilter.php
+++ b/apps/user_ldap/templates/part.wizard-groupfilter.php
@@ -35,7 +35,7 @@
- 0 t('group(s) found'));?>
+ 0 t('groups found'));?>
diff --git a/apps/user_ldap/templates/part.wizard-userfilter.php b/apps/user_ldap/templates/part.wizard-userfilter.php
index 146e6bb739..c1d522ce2a 100644
--- a/apps/user_ldap/templates/part.wizard-userfilter.php
+++ b/apps/user_ldap/templates/part.wizard-userfilter.php
@@ -35,7 +35,7 @@
- 0 t('user(s) found'));?>
+ 0 t('users found'));?>