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

bisitz lon-capa-cvs-allow@mail.lon-capa.org
Mon, 21 Jan 2008 11:36:08 -0000


bisitz		Mon Jan 21 06:36:08 2008 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  Localization:
  Added missing &mt(...) and optimzied the usage at some places
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.186 loncom/interface/portfolio.pm:1.187
--- loncom/interface/portfolio.pm:1.186	Tue Jul 10 16:51:46 2007
+++ loncom/interface/portfolio.pm	Mon Jan 21 06:36:07 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # portfolio browser
 #
-# $Id: portfolio.pm,v 1.186 2007/07/10 20:51:46 albertel Exp $
+# $Id: portfolio.pm,v 1.187 2008/01/21 11:36:07 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -99,7 +99,7 @@
 	my $help_createdir = &Apache::loncommon::help_open_topic('Portfolio CreateDirectory');
 		
 	# FIXME: This line should be deleted once Portfolio uses breadcrumbs
-	$r->print(&Apache::loncommon::help_open_topic('Portfolio About', 'Help on the portfolio'));
+	$r->print(&Apache::loncommon::help_open_topic('Portfolio About', &mt('Help on the portfolio')));
 
         $r->print(<<"TABLE"); 
 <table id="LC_portfolio_actions">
@@ -267,15 +267,16 @@
     } else {
         $r->print('<form method="post" action="'.$url.'">');
 	$r->print(&Apache::loncommon::help_open_topic('Portfolio FileList',
-						      'Using the portfolio file list'));
+						      &mt('Using the portfolio file list')));
         $r->print('<table id="LC_browser">'.
-		  '<tr><th colspan="2">Actions'.
-		  &Apache::loncommon::help_open_topic('Portfolio FileAction').
-		  '</th><th>&nbsp;</th><th>&nbsp;</th><th>Name'.
-		  &Apache::loncommon::help_open_topic('Portfolio OpenFile').
-		  '</th><th>Size</th><th>Last Modified</th><th>Current Access Status'.
-		  &Apache::loncommon::help_open_topic('Portfolio ShareFile').
-		  '</th></tr>');
+                  '<tr>'
+                 .'<th colspan="2">'.&mt('Actions'). &Apache::loncommon::help_open_topic('Portfolio FileAction').'</th>'
+                 .'<th>&nbsp;</th><th>&nbsp;</th>'
+                 .'<th>'.&mt('Name').&Apache::loncommon::help_open_topic('Portfolio OpenFile').'</th>'
+                 .'<th>'.&mt('Size').'</th>'
+                 .'<th>'.&mt('Last Modified').'</th>'
+                 .'<th>'.&mt('Current Access Status').&Apache::loncommon::help_open_topic('Portfolio ShareFile').'</th>'
+                 .'</tr>');
     }
     $r->print("\n".&group_form_data()."\n");
 
@@ -449,7 +450,7 @@
         $r->print('</table>');
         if ($can_delete) {
             $r->print('
-        <input type="submit" name="doit" value="Delete Checked Files" />'.
+        <input type="submit" name="doit" value="'.&mt('Delete Checked Files').'" />'.
 	&Apache::loncommon::help_open_topic('Portfolio DeleteFile').'
         <input type="hidden" name="action" value="delete" />
         <input type="hidden" name="currentpath" value="'.$current_path.'" />
@@ -564,10 +565,10 @@
 					       $env{'form.currentpath'}.
 					       $delete_file);
         if ($result ne 'ok') {
-	    $r->print('<span class="LC_error">'.
-                     &mt('An error occurred ([_1]) while trying to delete 
-                         [_2].',$result,&display_file(undef, $delete_file)).
-                      '</span><br /><br />');
+	    $r->print('<span class="LC_error">'
+                      .&mt('An error occurred ([_1]) while trying to delete [_2].'
+                         ,$result,&display_file(undef, $delete_file))
+                      .'</span><br /><br />');
         } else {
             $r->print(&mt('File: [_1] deleted.',
                           &display_file(undef,$delete_file)));
@@ -774,14 +775,14 @@
     if ($can_setacl) {
         &open_form($r,$url);
         $r->print($header.$info);
-	$r->print('<br />'.&Apache::loncommon::help_open_topic('Portfolio ShareFile SetAccess', 'Help on setting up share access'));
-	$r->print(&Apache::loncommon::help_open_topic('Portfolio ShareFile ChangeSetting', 'Help on changing settings'));
-	$r->print(&Apache::loncommon::help_open_topic('Portfolio ShareFile StopAccess', 'Help on removing share access'));
+	$r->print('<br />'.&Apache::loncommon::help_open_topic('Portfolio ShareFile SetAccess', &mt('Help on setting up share access')));
+	$r->print(&Apache::loncommon::help_open_topic('Portfolio ShareFile ChangeSetting', &mt('Help on changing settings')));
+	$r->print(&Apache::loncommon::help_open_topic('Portfolio ShareFile StopAccess', &mt('Help on removing share access')));
         &access_setting_table($r,$url,$file_name,$access_controls{$file_name},
                               $action);
         my $button_text = {
                         'continue' => &mt('Proceed'),
-                        'cancel' => &mt('Back to directory listing'),
+                        'cancel' => &mt('Back to Directory'),
                       };
         &close_form($r,$url,$button_text);
     } else {
@@ -1198,7 +1199,7 @@
 sub standard_settings {
     my ($r,$now,$then,$url,$filename,$acl_count,$start,$end,$public,$publicnum,
       $publictext,$guest,$guestnum,$guesttext,$access_controls,%conditionals)=@_;
-    $r->print('<h3>'.&mt('Public access: [_1]',$publictext).'</h3>');
+    $r->print('<h3>'.&mt('Public access: [_1]',&mt($publictext)).'</h3>');
     $r->print(&Apache::loncommon::start_data_table());
     $r->print(&Apache::loncommon::start_data_table_header_row());
     $r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available').'</th>');
@@ -1214,7 +1215,7 @@
     $r->print(&Apache::loncommon::end_data_table_row());
     $r->print(&Apache::loncommon::end_data_table());
     $r->print('</td><td width="40">&nbsp;</td><td valign="top">');
-    $r->print('<h3>'.&mt('Passphrase-protected access: [_1]',$guesttext).'</h3>');
+    $r->print('<h3>'.&mt('Passphrase-protected access: [_1]',&mt($guesttext)).'</h3>');
     $r->print(&Apache::loncommon::start_data_table());
     $r->print(&Apache::loncommon::start_data_table_header_row());
     $r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available').
@@ -1260,7 +1261,7 @@
             'action' => 'chgconditions',
             'currentpath' => $env{'form.currentpath'},
         );
-    $r->print('<h3>'.&mt('Conditional access: [_1]',$conditionstext).'</h3>');
+    $r->print('<h3>'.&mt('Conditional access: [_1]',&mt($conditionstext)).'</h3>');
     if ($numconditionals > 0) {
         my $count = 1;
         my $chg = 'none';
@@ -1365,8 +1366,8 @@
         }
         $r->print(&Apache::loncommon::end_data_table());
     } else {
-        $r->print(&mt('No [_1]-based conditions defined.<br />',$type).
-                  &additional_item($type));
+        $r->print(&mt('No [_1]-based conditions defined.',$type).'<br />'
+                  .&additional_item($type));
     }
     return;
 }
@@ -1955,7 +1956,7 @@
     }
     if ($found_file){
     	    $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 />');
+    	            '</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();
@@ -1967,7 +1968,7 @@
         }
     }
     if ($newdir ne $env{'form.newdir'}) {
-        $r->print(&mt("The new directory name was changed from:<br /><strong>").$env{'form.newdir'}."</strong> ".&mt('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));
 }