steffen: server/kolab-webadmin/kolab-webadmin/www/admin/sharedfolder index.php, 1.7, 1.7.2.1 sf.php, 1.20.2.1, 1.20.2.2

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/sharedfolder
In directory doto:/tmp/cvs-serv29446/kolab-webadmin/www/admin/sharedfolder

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

Index: index.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/sharedfolder/index.php,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -d -r1.7 -r1.7.2.1
--- index.php	11 Mar 2005 09:11:15 -0000	1.7
+++ index.php	13 Oct 2005 01:50:25 -0000	1.7.2.1
@@ -36,7 +36,7 @@
   $result = ldap_search($ldap->connection, $base_dn, $filter);
   if( $result ) {
 	$count = ldap_count_entries($ldap->connection, $result);
-	$title = _("Manage Shared Folders ($count Folders)");
+	$title = sprintf( _("Manage Shared Folders (%d Folders)"), $count );
 	$template = 'sflistall.tpl';
 	ldap_sort($ldap->connection,$result,'cn');
 	$entry = ldap_first_entry($ldap->connection, $result);

Index: sf.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/sharedfolder/sf.php,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -u -d -r1.20.2.1 -r1.20.2.2
--- sf.php	28 Jul 2005 01:45:41 -0000	1.20.2.1
+++ sf.php	13 Oct 2005 01:50:25 -0000	1.20.2.2
@@ -97,7 +97,7 @@
 	  }
 	}
   }
-  $errors[] = _("No UID or GID $uid");
+  $errors[] = sprintf( _("No UID or GID %s"), $uid);
   return false;
 }
 
@@ -138,7 +138,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 ));
   }
 }
 
@@ -212,18 +212,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 %1\$s to %2\$s: %3\$s"), $dn, $newdn,
+											   ldap_error($ldap->connection)));
 				} else {
 				  $messages[] = _('Shared folder 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[] = _('Shared folder updated');
 			}
 		  } 
@@ -232,9 +232,9 @@
 			$dn = "cn=".$ldap_object['cn'].",".$sf_root;
 			$ldap_object['kolabHomeServer'] = trim($_POST['kolabhomeserver']);
 			if ($dn && !ldap_add($ldap->connection, $dn, $ldap_object)) 
-			  array_push($errors, _("LDAP Error: could not add object $dn: ")
-						 .ldap_error($ldap->connection));
-			else $messages[] = _("Shared folder '$cn' added");
+			  array_push($errors, sprintf(_("LDAP Error: could not add object %s: %s"), $dn,
+										  ldap_error($ldap->connection)));
+			else $messages[] = sprintf( _("Shared folder '%s' added"), $cn );
 		  }
 		  if ($errors) {
 			//print("<div class=\"maintitle\"> Create New Address Book Entry </div>\n");
@@ -266,7 +266,7 @@
 	  $heading = _('Modify Shared Folder');
 	  $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':
@@ -281,17 +281,17 @@
 	  $heading = _('Delete Shared Folder');
 	  $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) {
 	  if( $ldap->deleteSharedFolder($dn) ) {
-		$messages[] = _('Shared folder ').$_REQUEST['cn']._(' marked for deletion');
+		$messages[] = sprintf( _("Shared folder %s marked for deletion"), $_REQUEST['cn'] );;
 		$heading = _('Entry Deleted');
 		$contenttemplate = 'sfdeleted.tpl';
 	  } else {
-		array_push($errors, _("LDAP Error: Could not mark $dn for deletion: ").ldap_error($link));		
+		array_push($errors, sprintf(_("LDAP Error: Could not mark %s for deletion: %s"), $dn, ldap_error($link)));
 	  }
 	}
 	break;





More information about the commits mailing list