[LON-CAPA-cvs] cvs: loncom /interface portfolio.pm

banghart lon-capa-cvs-allow@mail.lon-capa.org
Thu, 21 Jun 2007 20:25:19 -0000


banghart		Thu Jun 21 16:25:19 2007 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  	Remove dead comments.
  	Localize a bunch of text. Not finished.
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.184 loncom/interface/portfolio.pm:1.185
--- loncom/interface/portfolio.pm:1.184	Mon Jun 11 17:29:44 2007
+++ loncom/interface/portfolio.pm	Thu Jun 21 16:25:18 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # portfolio browser
 #
-# $Id: portfolio.pm,v 1.184 2007/06/11 21:29:44 albertel Exp $
+# $Id: portfolio.pm,v 1.185 2007/06/21 20:25:18 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -289,8 +289,6 @@
 			  my ($bfile)=split('&',$b,2);
 			  return (lc($afile) cmp lc($bfile));
 		      } (@$dir_list)) {
-    	#$strip holds directory/file name
-    	#$dom 
     	my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$dir_line,16); 
     	$filename =~ s/\s+$//;
     	my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename);
@@ -630,11 +628,8 @@
 		  ') while trying to delete '.$directory_name.'</span><br />');
     } else {
         # now remove from recent
-#        $r->print('<br /> removing '.$directory_name.'<br /');
         &Apache::lonhtmlcommon::remove_recent($namespace,[$directory_name.'/']);
         my @dirs = split m!/!, $directory_name;
-        
-#        $directory_name =~ m/^(\/*\/)(\/*.)$/;
         $directory_name='/';
         for (my $i=1; $i < (@dirs - 1); $i ++){
             $directory_name .= $dirs[$i].'/';
@@ -1739,11 +1734,11 @@
         </script>
 ENDSMP
     $r->print($javascript);
-    $r->print("<h1>Select portfolio files</h1>
-                Check as many as you wish in response to the problem.<br />");
+    $r->print("<h1>".&mt('Select portfolio files')."</h1>".
+                &mt('Check as many as you wish in response to the problem.')."<br />");
     my @otherfiles=&Apache::lonnet::files_not_in_path($env{'user.name'}, $env{'form.currentpath'});
     if (@otherfiles) {
-	$r->print("<strong>Files selected from other directories:</strong><br />");
+	$r->print("<strong>".&mt('Files selected from other directories:')."</strong><br />");
 	foreach my $file (@otherfiles) {
 	    $r->print($file."<br />");
 	}
@@ -1777,17 +1772,23 @@
     my $current_disk_usage = &Apache::lonnet::diskusage($udom,$uname,$portfolio_root);
 
     if (($current_disk_usage + $filesize) > $disk_quota){
-        my $msg = '<span class="LC_error">Unable to upload <strong>'.$fname.' (size = '.$filesize.' kilobytes)</strong>. Disk quota will be exceeded.</span>'.
-	    '<br />Disk quota is '.$disk_quota.' kilobytes. Your current disk usage is '.$current_disk_usage.' kilobytes.';
+        my $msg = '<span class="LC_error">'.
+                &mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.','<span class="LC_filename">'.$fname.'</span>',$filesize).'</span>'.
+                  '<br />'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',$disk_quota,$current_disk_usage);
 	return ('will_exceed_quota',$msg);
     } elsif ($found_file) {
         if ($locked_file) {
-            my $msg = '<span class="LC_error">'.'Unable to upload <strong>'.$fname.'</strong>, a <strong>locked</strong> file by that name was found in <strong>'.$port_path.$path.'</strong></span>'.
-		'<br />You will be able to rename or delete existing '.$fname.' after a grade has been assigned.';
+            my $msg = '<span class="LC_error">';
+            $msg .= &mt('Unable to upload [_1] a locked file by that name was found in [_2].','<span class="LC_filename">'.$fname.'</span>','<span class="LC_filename">'.$port_path.$env{'form.currentpath'}.'</span>');
+            $msg .= '</span><br />';
+            $msg .= &mt('You will be able to rename or delete existing [_1] after a grade has been assigned.','<span class="LC_filename">'.$fname.'</span>');
 	    return ('file_locked',$msg);
 	} else {
-            my $msg = '<span class="LC_error">'.'Unable to upload <strong>'.$fname.'</strong>, a file by that name was found in <strong>'.$port_path.$path.'</strong></span>'.
-		'<br />To upload, rename or delete existing '.$fname.' in '.$port_path.$path;
+            my $msg = '<span class="LC_error">';
+            $msg .= &mt('Unable to upload [_1]. A file by that name was found in [_2].','<span class="LC_filename">'.$fname.'</span>',$port_path.$env{'form.currentpath'});
+            $msg .= '</span>';
+            $msg .= '<br />';
+            $msg .= &mt('To upload, rename or delete existing [_1] in [_2].','<span class="LC_filename">'.$fname.'</span>', $port_path.$env{'form.currentpath'});
 	    return ('file_exists',$msg);
 	}
     }
@@ -1928,7 +1929,7 @@
 	    }
         }
     }
-    $r->print(&done('Back',$url));
+    $r->print(&done(&mt('Back'),$url));
     return 'ok';
 }
 
@@ -1952,8 +1953,8 @@
         }
     }
     if ($found_file){
-    	    $r->print('<span class="LC_error">'.'Unable to create a directory named <strong>'.$newdir.
-    	            ' </strong>a file or directory by that name already exists.</span><br />');
+    	    $r->print('<span class="LC_error">'.&mt('Unable to create a directory named').' <strong>'.$newdir.
+    	            ' </strong>'.&mt('a file or directory by that name already exists.').'</span><br />');
     } else {
         my ($uname,$udom) = &get_name_dom();
         my $port_path = &get_port_path();
@@ -1965,7 +1966,7 @@
         }
     }
     if ($newdir ne $env{'form.newdir'}) {
-        $r->print("The new directory name was changed from:<br /><strong>".$env{'form.newdir'}."</strong> to <strong>$newdir </strong>");  
+        $r->print(&mt("The new directory name was changed from:<br /><strong>").$env{'form.newdir'}."</strong> ".&mt('to')." <strong>$newdir </strong>");  
     }
     $r->print(&done(undef,$url));
 }
@@ -2160,16 +2161,16 @@
                                       $env{'request.course.id'}.'/'.$group))) {
                     $portfolio_root = &get_portfolio_root();
                 } else {
-                    $r->print('You do not have the privileges required to access the shared files space for this group.');
+                    $r->print(&mt('You do not have the privileges required to access the shared files space for this group.'));
                     $earlyout = 1;
                 }
             } else {
-                $r->print('Not a valid group for this course');
+                $r->print(&mt('Not a valid group for this course'));
                 $earlyout = 1;
             }
             $title = &mt('Group files').' for '.$group; 
         } else {
-            $r->print('Invalid group');
+            $r->print(&mt('Invalid group'));
             $earlyout = 1;
         }
         if ($earlyout) { return OK; }
@@ -2225,16 +2226,14 @@
          return OK;
     }
 	if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){
-   	    $r->print('<span class="LC_error">'.
-		      'No file was selected to upload.'.
-		      'To upload a file, click <strong>Browse...</strong>'.
-		      ', select a file, then click <strong>Upload</strong>.'.
-		      '</span>');
+   	    $r->print('<span class="LC_error">');
+   	    $r->print(&mt('No file was selected to upload. '));
+	    $r->print(&mt('To upload a file, click <strong>Browse...</strong> select a file, then click <strong>Upload</strong>.'));
+	    $r->print('</span>');
 	}
     if ($env{'form.meta'}) {
         &open_form($r,$url);
-#        $r->print(&edit_meta_data($r, $env{'form.currentpath'}.$env{'form.selectfile'}));
-        $r->print('Edit the meta data<br />');
+        $r->print(&mt('Edit the meta data').'<br />');
         &close_form($r,$url);
     }
     if ($env{'form.store'}) {