steffen: server/kolab-webadmin/kolab-webadmin/www/admin/distributionlist index.php, 1.9.2.1, 1.9.2.2 list.php, 1.16.2.2, 1.16.2.3

cvs at intevation.de cvs at intevation.de
Thu Oct 13 03:50:27 CEST 2005


Author: steffen

Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/distributionlist
In directory doto:/tmp/cvs-serv29446/kolab-webadmin/www/admin/distributionlist

Modified Files:
      Tag: kolab_2_0_branch
	index.php list.php 
Log Message:
Fix for issue886 (i18n problem)

Index: index.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/distributionlist/index.php,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -u -d -r1.9.2.1 -r1.9.2.2
--- index.php	28 Jul 2005 01:45:41 -0000	1.9.2.1
+++ index.php	13 Oct 2005 01:50:25 -0000	1.9.2.2
@@ -49,7 +49,7 @@
   $result = ldap_search($ldap->connection, $base_dn, $filter);
   if( $result ) {
 	$count = ldap_count_entries($ldap->connection, $result);
-	$title = _("Manage Distribution Lists ($count Lists)");
+	$title = sprintf( _("Manage Distribution Lists (%d Lists)"), $count );
 	$template = 'distlistall.tpl';
 	ldap_sort($ldap->connection,$result,'cn');
 	$entry = ldap_first_entry($ldap->connection, $result);

Index: list.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/distributionlist/list.php,v
retrieving revision 1.16.2.2
retrieving revision 1.16.2.3
diff -u -d -r1.16.2.2 -r1.16.2.3
--- list.php	15 Sep 2005 11:59:23 -0000	1.16.2.2
+++ list.php	13 Oct 2005 01:50:25 -0000	1.16.2.3
@@ -46,7 +46,7 @@
 	foreach( $lst as $a ) {
 	  debug("Trying $a");
 	  ($dn = $ldap->dnForMail($a)) || ($dn = $ldap->dnForUid($a)) || ($dn = $ldap->dnForAlias($a));
-	  if( !$dn ) return _("No user with email address, UID or alias $a");
+	  if( !$dn ) return sprintf(_("No user with email address, UID or alias %s"), $a);
 	}
   }
   return '';
@@ -141,7 +141,7 @@
   if( $_REQUEST['dn'] ) {
 	$dn = $_REQUEST['dn'];
   } else {  
-	array_push($errors, _("Error: DN required for $action operation") );
+	array_push($errors, sprintf( _("Error: DN required for %s operation"), $action ) );
   }
 }
 
@@ -185,7 +185,7 @@
 		  if( $memberdn ) {
 			$ldap_object['member'][] = $memberdn;
 		  } else {
-			$errors[] = _("No user with address $a");
+			$errors[] = sprintf( _("No user with address %s"), $a);
 			break;
 		  }
 		}
@@ -201,18 +201,18 @@
 				  ($oldattrs=ldap_get_attributes($ldap->connection,$entry))) {
 				if (!ldap_add($ldap->connection,$newdn, $ldap_object) 
 					|| !ldap_delete($ldap->connection,$dn)) {
-				  array_push($errors, _("LDAP Error: Could not rename $dn to $newdn: ")
-							 .ldap_error($ldap->connection));
+				  array_push($errors, sprintf( _("LDAP Error: Could not rename %s to %s: %s"), $dn, $newdn,
+											   ldap_error($ldap->connection)) );
 				} else {
 				  $messages[] = _('Distribution List updated');
 				}
 				$dn = $newdn;
-			  } else array_push($errors, _("LDAP Error: Could not read $dn: ")
-								.ldap_error($ldap->connection));
+			  } else array_push($errors, sprintf( _("LDAP Error: Could not read %s: %s"), $dn,
+												  ldap_error($ldap->connection)) );
 			} else {
 			  if (!ldap_modify($ldap->connection, $dn, $ldap_object))
-				array_push($errors, _("LDAP Error: Could not modify object $dn: ")
-						   .ldap_error($ldap->connection)); 
+				array_push($errors, sprintf( _("LDAP Error: Could not modify object %s: %s"), $dn,
+											 ldap_error($ldap->connection)) ); 
 			  else $messages[] = _('Distribution List updated');
 			}
 		  } 
@@ -222,8 +222,8 @@
 			if( !$ldap_object['member'] ) unset($ldap_object['member']); 
 			$dn = "cn=".$ldap_object['cn'].",".$dl_root;
 			if ($dn && !ldap_add($ldap->connection, $dn, $ldap_object)) {
-			  array_push($errors, _("LDAP Error: Could not add object $dn: ")
-						 .ldap_error($ldap->connection));
+			  array_push($errors, sprintf( _("LDAP Error: Could not add object %s: %s"), $dn,
+										   ldap_error($ldap->connection)) );
 			  debug("dn is $dn");
 			  debug_var_dump( $ldap_object );
 			}
@@ -240,17 +240,17 @@
 				  $ldap_object['cn'] = $newcn; 
 				  $ldap_object['dn'] = 'cn='.$ldap->escape($newcn).','.$dl_root;
 				  if (!ldap_rename($ldap->connection, $dn, 'cn='.$ldap->escape($newcn), $dl_root,true)) {
-					$errors[] = _("LDAP Error: Could not modify object $dn: ")
-					  .ldap_error($ldap->connection);
+					$errors[] = sprintf( _("LDAP Error: Could not modify object %s: %s"), $dn,
+										 ldap_error($ldap->connection) );
 				  }
-				  $error[] = _("Mid-air collision detected, email address $mail renamed to $newmail");
+				  $error[] = sprintf( _("Mid-air collision detected, email address %1\$s was renamed to %2\$s"), $mail, $newmail );
 				  break;
 				}
 			  }
 			}
 		  }
 		  if( !$errors ) {
-			$messages[] = _("Distribution List '$cn' added");
+			$messages[] = sprintf( _("Distribution List '%s' added"), $cn );
 		  }
 		}
 		if ($errors) {
@@ -279,7 +279,7 @@
 	  $heading = _('Modify Distribution List');
 	  $content = $form->outputForm();
 	} else {
-		array_push($errors, _("Error: No results returned for DN '$dn'"));
+	  array_push($errors, sprintf( _("Error: No results returned for DN '%s'"), $dn ));
 	}
 	break;
   case 'delete':
@@ -294,18 +294,18 @@
 	  $heading = _('Delete Distribution List'); 
 	  $content = $form->outputForm();
 	} else {
-	  array_push($errors, _("Error: No results returned for DN '$dn'"));
+	  array_push($errors, sprintf( _("Error: No results returned for DN '%s'"), $dn) );
 	}
 	break;
   case 'kill':
 	if (!$errors) {
 	  /* Just delete the object and let kolabd clean up */
 	  if( $ldap->deleteGroupOfNames($dn) ) {
-		$messages[] = _('Distribution List ').$_REQUEST['cn']._(' deleted');
+		$messages[] = sprintf( _("Distribution List %s deleted"), $_REQUEST['cn'] );;
 		$heading = _('Entry Deleted');
 		$contenttemplate = 'sfdeleted.tpl';
 	  } else {
-		array_push($errors, _("LDAP Error: could delete $dn: ").ldap_error($link));		
+		array_push($errors, sprintf( _("LDAP Error: could not delete %s: %s"), $dn, ldap_error($link)));
 	  }
 	}
 	break;





More information about the commits mailing list