--- avatarcrop.module.orig	2009-02-09 15:11:32.000000000 +0100
+++ avatarcrop.module	2009-04-22 16:11:56.000000000 +0200
@@ -4,26 +4,26 @@
 	return array('Avatar crop');
 }
 function avatarcrop_init() {
-	
+
 	$dimension=variable_get('user_picture_dimensions','100x100');
 	$widthXheight=split('x',$dimension);
 	$width = $widthXheight[0];
 	$height = $widthXheight[1];
-	
+
 	drupal_add_js('var cwidth = '. $width .';','inline');
 	drupal_add_js('var cheight = '.$height.';','inline');
-	
+
 	drupal_add_js(drupal_get_path('module','avatarcrop').'/avatarcrop.js');
 	drupal_add_js(drupal_get_path('module','avatarcrop').'/js/jquery.Jcrop.js');
 	drupal_add_css(drupal_get_path('module','avatarcrop').'/css/jquery.Jcrop.css');
 	drupal_add_css(drupal_get_path('module','avatarcrop').'/avatarcrop.css');
-	
 
-	
+
+
 }
 
 function avatarcrop_menu() {
-	
+
 $items = array();
 
 $items['user/cropimage'] = array(
@@ -39,21 +39,21 @@
 	'page arguments' => array('avatarcrop_form'),
     'access arguments' =>  avatarcrop_perm(),
     'type' => MENU_CALLBACK
-  );  
+  );
 
 return $items;
 }
-  
+
 function avatarcrop_user($op, &$edit, &$users, $category = NULL){
 	switch ($op){
 		case 'view' :
 			$enablePicture=variable_get('user_pictures','0');
 			if($enablePicture) {
 				if($users->picture){
-					$pictureMsg = 'Change Avatar';
+					$pictureMsg = t('Change Avatar');
 				}
 				else {
-					$pictureMsg = 'Upload Picture';
+					$pictureMsg = t('Upload Picture');
 				}
 				$base=base_path();
 				global $user;
@@ -62,9 +62,9 @@
 					$users->content['user_picture']['link_to_crop'] = array(
 				      	'#prefix' => '<div class="picture">',
 		  				'#suffix' => '</div>',
-					  	'#value' => '<a href="'.$base.'user/getimage" class="avatar-crop-picture">'. $pictureMsg .'</a>', 
+					  	'#value' => '<a href="'.$base.'user/getimage" class="avatar-crop-picture">'. $pictureMsg .'</a>',
 				      	'#weight' => -10,
-					
+
 				    );
 				}
 			}
@@ -79,13 +79,13 @@
 function avatarcrop_form() {
 $form = array();
   // If this #attribute is not present, upload will fail on submit
-  
+
 	$form['#attributes']['enctype'] = 'multipart/form-data';
-	
+
 	$form['avatar_crop_title']=array(
 		'#prefix' => '<div class="avatar-crop-title">',
   		'#suffix' => '</div>',
-  		'#value' => 'Choose profile picture.',
+  		'#value' => t('Choose profile picture.'),
     );
   	$form['file_upload'] = array(
     	'#title' => t('Upload file'),
@@ -93,9 +93,9 @@
   	);
   	$form['submit_upload'] = array(
     	'#type'  =>  'submit',
-    	'#value'  =>  'Upload'
+    	'#value'  =>  t('Upload')
   );
-  
+
   $enablePicture=variable_get('user_pictures','0');
 	if($enablePicture) {
 		return $form;
@@ -104,35 +104,35 @@
 		$form2['user_picture_disable']=array(
 			'#prefix' => '<div class="message error">',
 	  		'#suffix' => '</div>',
-		  	'#value' => 'Please enable user picture first to use Avatar crop.',
+		  	'#value' => t('Please enable user picture first to use Avatar crop.'),
 	    );
 	    return $form2;
 	}
-	
-  
+
+
 }
 function avatarcrop_form_submit($form, &$form_state) {
   $validators = array(
   	'file_validate_is_image' => array(),
     'file_validate_image_resolution' => array('500x500'),
     'file_validate_size' => array(500 * 1024),
-  
+
   );
   $upload_dir=variable_get('user_picture_path','pictures');
   $filepath=file_directory_path();
   $dest = $filepath . '/' .$upload_dir;
   $file = file_save_upload('file_upload', $validators, $dest);
-  
+
   if ($file != 0) {
-      
+
   	//$dest_path = 'files/upload_directory';
     $result = file_copy($file, $dest, FILE_EXISTS_RENAME);
        if ($result == 1) {
-       	
+
     	$_SESSION['filepath']=$file->filepath;
     	$_SESSION['fid']=$file->fid;
     	$_SESSION['filetype']=$file->filemime;
-    	
+
     	drupal_goto('user/cropimage');
     }
     else {
@@ -143,8 +143,8 @@
     form_set_error('', t("Failed to upload the file."));
   }
 
-  
-  
+
+
 }
 
 /**
@@ -153,22 +153,22 @@
  * @return unknown
  */
 function cropUserPic() {
-	
+
 	$form=array();
 	$filePath = $_SESSION['filepath'];
-	
+
   	$enablePicture=variable_get('user_pictures','0');
-  	
+
 	if($enablePicture==0) {
 		$_SESSION['filepath']=null;
 	}
-	
+
 	$base=base_path();
 	if($filePath){
 		$form['avatar_crop_title']=array(
 			'#prefix' => '<div class="avatar-crop-title">',
   			'#suffix' => '</div>',
-  			'#value' => 'Make a selection on the below image to define the crop area.',
+  			'#value' => t('Make a selection on the below image to define the crop area.'),
     	);
 		$form['imageview']= array(
 			'#value' => '<img src="'. $base.$filePath .'"  id="cropbox" />',
@@ -194,15 +194,15 @@
 		);
 		$form['cropsubmit'] = array(
 			'#type' => 'submit',
-			'#value' => 'Continue',
+			'#value' => t('Continue'),
 			//'#submit' => array('cropSubmit'),
 		);
-		
+
 	}
 
-	
+
 	return $form;
-	
+
 }
 
 /**
@@ -211,20 +211,20 @@
 function cropUserPic_validate($form, &$form_state){
 	$w=$form_state['values']['w'];
 	$h=$form_state['values']['h'];
-		
+
 	if(!$h){
-		form_set_error('','Please crop the image to continue.');
+		form_set_error('', t('Please crop the image to continue.'));
 	}
-	
+
 }
 
 function cropUserPic_submit($form, &$form_state)
 {
-	
+
 	$dimension=variable_get('user_picture_dimensions','100x100');
-	
+
 	$widthXheight=split('x',$dimension);
-	
+
 	$targ_w = $widthXheight[0];
 	$targ_h = $widthXheight[1];
 	$jpeg_quality = 90;
@@ -233,11 +233,11 @@
 	$y=$form_state['values']['y1'];
 	$w=$form_state['values']['w'];
 	$h=$form_state['values']['h'];
-	
-	
+
+
 	$src = $_SESSION['filepath'];
 	$filetype=$_SESSION['filetype'];
-	
+
 	$dst_r = ImageCreateTrueColor( $targ_w, $targ_h );
 	switch ($filetype) {
 		case 'image/jpeg':
@@ -254,23 +254,23 @@
 			$img_r = imagecreatefromgif($src);
 			imagecopyresampled($dst_r,$img_r,0,0,$x,$y,$targ_w,$targ_h,$w,$h);
 			imagegif($dst_r,$src);
-			break;			
+			break;
 	}
-	
+
 	global $user;
 	db_query("update {users} set picture='%s' where uid=%d",$src,$user->uid);
 			///cleaning the sessions
 			$_SESSION['filepath']=NULL;
 	    	$_SESSION['fid']=NULL;
 	    	$_SESSION['filetype']=NULL;
-	
+
 	drupal_goto('user/'.$user->uid);
-	
-	
+
+
 }
 
 /**
- * 
+ *
  * hide the picture fieldset
  *
  * @param  $form
@@ -281,12 +281,12 @@
 function avatarcrop_form_alter(&$form, &$form_state, $form_id) {
 
 if ($form_id == 'user_profile_form') {
-/*	$base=base_path();	
+/*	$base=base_path();
 	$form['picture']['picture_upload'] = array(
 		'#value' => '<a href="'.$base.'user/getimage" class="avatar-crop-picture">'. 'Upload picture' .'</a>',
 	);*/
 	$form['picture']=array();
-	
-   		
+
+
   }
-}	
+}
